/* ===== App shell — floating sidebar, glass top bar, floating bottom nav (same layout as Hall Management) ===== */
html.app-shell, html.app-shell body { height: 100%; overflow: hidden; }
html.app-shell.doc-scroll, html.app-shell.doc-scroll body { height: auto; overflow: visible; }
.frame { display: flex; flex-direction: row; flex-wrap: nowrap; height: 100vh; height: 100dvh; }
.doc-scroll .frame { display: block; height: auto; min-height: 100dvh; }
.main { flex: 1 1 0; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.doc-scroll .main { display: block; overflow: visible; }
.content { width: 100%; max-width: 1440px; margin: 0 auto; padding: 26px 32px calc(56px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 24px; }
.doc-scroll .content { padding: 16px 16px calc(var(--nav-gap) + 104px); gap: 18px; }

/* Floating sidebar */
.sb-wrap { flex: 0 0 272px; width: 272px; height: 100%; padding: 12px 0; padding-inline-start: 12px; }
.sb { position: relative; height: 100%; border-radius: 26px; background: var(--sb); color: var(--sb-ink); display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .06), 0 20px 44px -18px color-mix(in srgb, var(--sb) 70%, transparent); }
.sb::before { content: ""; position: absolute; inset: -40% -30% auto auto; width: 260px; height: 260px; border-radius: 50%; background: var(--grad); opacity: .18; filter: blur(40px); pointer-events: none; }
.sb-brand { position: relative; display: flex; align-items: center; gap: 12px; padding: 24px 20px 20px; }
.sb-brand-name { font-family: var(--display); font-size: 24px; line-height: 1.25; color: #fff; }
.sb-brand-co { font-size: 12px; color: var(--sb-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-scroll { position: relative; flex: 1; min-height: 0; overflow-y: auto; padding: 0 12px 12px; display: flex; flex-direction: column; gap: 20px; scrollbar-width: thin; scrollbar-color: var(--sb-2) transparent; }
.sb-group { display: flex; flex-direction: column; gap: 2px; }
.sb-group-label { padding: 0 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: .02em; color: var(--sb-dim); }
.sb-link { position: relative; display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border-radius: 12px; color: var(--sb-ink); font-size: 14.5px; font-weight: 500; transition: background-color .3s, color .3s; }
.sb-link:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.sb-link .sb-ic { transition: transform .3s; }
.sb-link:hover .sb-ic { transform: scale(1.12); }
.sb-link.on { background: rgba(255, 255, 255, .09); color: #fff; font-weight: 600; }
.sb-link.on .sb-ic { color: var(--sb-accent); }
.sb-link.on::before { content: ""; position: absolute; inset-inline-start: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 99px; background: var(--sb-accent); }
.sb-count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; background: rgba(255, 255, 255, .1); color: #fff; font-size: 11.5px; font-weight: 700; line-height: 22px; text-align: center; }
.sb-create { margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border: 1.5px dashed color-mix(in srgb, var(--sb-accent) 55%, transparent);
  border-radius: 14px; background: transparent; color: var(--sb-accent); font-weight: 700; cursor: pointer; transition: background-color .2s; }
.sb-create:hover { background: rgba(255, 255, 255, .06); }
.sb-user { position: relative; margin: 0 12px 12px; border-radius: 16px; background: rgba(255, 255, 255, .07); padding: 12px; display: flex; align-items: center; gap: 12px; }
.sb-avatar { --s: 40px; background: rgba(255, 255, 255, .12); box-shadow: none; }
.sb-user-link { flex: 1; min-width: 0; color: inherit; }
.sb-user-link:hover .sb-user-name { color: var(--sb-accent); }
.sb-user-name { font-size: 14px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-role { font-size: 11px; color: var(--sb-dim); direction: rtl; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-logout { width: 36px; height: 36px; flex: none; border: 0; border-radius: 10px; background: transparent; color: var(--sb-ink); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background-color .2s, color .2s; }
.sb-logout:hover { background: rgba(255, 255, 255, .1); color: #fff; }

/* Glass top bar (sticky inside the scroll root) */
.tb { position: sticky; top: 0; z-index: 30; flex: none; background: color-mix(in srgb, var(--bg) 74%, transparent); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.tb-in { position: relative; display: flex; align-items: center; justify-content: flex-end; gap: 10px; height: 68px; padding: 0 32px; }
.tb-page { margin-inline-end: auto; font-family: var(--display); font-weight: 400; font-size: 24px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-title { position: absolute; inset-inline: 64px; text-align: center; font-weight: 800; font-size: 17px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.tb-logo { margin-inline-end: auto; position: relative; z-index: 1; display: flex; }
.tb-search { display: flex; align-items: center; gap: 8px; width: min(340px, 32vw); height: 42px; padding: 0 14px; border-radius: 14px; background: color-mix(in srgb, var(--card) 80%, transparent);
  border: 1.5px solid var(--line); color: var(--ink-3); transition: border-color .2s, box-shadow .2s; }
.tb-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); }
.tb-search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; color: var(--ink); }
.tb-bell { position: relative; background: color-mix(in srgb, var(--card) 70%, transparent); }
.bell-dot { position: absolute; top: 2px; inset-inline-end: 0; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 800;
  line-height: 19px; text-align: center; box-shadow: 0 0 0 2px var(--bg); animation: ping-in .5s var(--spring); }
@keyframes ping-in { from { transform: scale(0); } }
@media (max-width: 1023px) {
  .tb-in { padding: 0 16px; padding-top: env(safe-area-inset-top, 0px); height: calc(62px + env(safe-area-inset-top, 0px)); }
  .tb-title { top: env(safe-area-inset-top, 0px); bottom: 0; display: flex; align-items: center; justify-content: center; }
}

/* Floating bottom nav (phone/tablet) — the bar floats --nav-gap above the screen edge, a solid strip fills behind its lower half */
.bnav-wrap { position: fixed; inset-inline: 0; bottom: 0; z-index: 30; padding: 0 12px var(--nav-gap); pointer-events: none; }
.bnav-strip { position: absolute; inset-inline: 0; bottom: 0; height: calc(var(--nav-gap) + 34px); background: var(--bg); }
.bnav { position: relative; height: 68px; border-radius: 22px; pointer-events: auto; background: rgba(255, 255, 255, .9); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  border: 1px solid var(--line); box-shadow: 0 2px 4px rgba(0, 0, 0, .04), 0 18px 40px -18px var(--shadow-c); display: flex; align-items: center; justify-content: space-around; padding: 0 6px; }
.bnav-tab { width: 64px; height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: transparent; border-radius: 16px;
  font: 700 11px var(--font); color: var(--ink-3); cursor: pointer; -webkit-tap-highlight-color: transparent; transition: color .2s; }
.bnav-tab.on { color: var(--accent-ink); }
.bnav-tab.on svg { animation: tab-hop .4s var(--spring); }
@keyframes tab-hop { 40% { transform: translateY(-4px) scale(1.1); } }
.bnav-fab { position: relative; width: 58px; height: 58px; margin-top: -30px; border-radius: 20px; border: 4px solid var(--bg); background: var(--grad); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 12px 26px -8px var(--glow); transition: transform .15s; -webkit-tap-highlight-color: transparent; }
.bnav-fab:active { transform: scale(.92); }
.bnav-fab.is-pop { animation: fab-pop .55s var(--spring); }
.bnav-fab.is-pop svg { animation: fab-spin .55s var(--spring); }
.bnav-fab.is-pop::after { content: ""; position: absolute; inset: -4px; border-radius: 24px; border: 2px solid var(--accent); animation: fab-ripple .6s ease-out forwards; pointer-events: none; }
@keyframes fab-pop { 0% { transform: scale(1); } 25% { transform: scale(.84); } 60% { transform: scale(1.1); } 100% { transform: scale(1); } }
@keyframes fab-spin { 0% { transform: rotate(0); } 100% { transform: rotate(90deg); } }
@keyframes fab-ripple { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(1.55); } }

/* "More" sheet */
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding-top: 4px; }
.more-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 4px; border: 0; border-radius: 16px; background: var(--card-2); color: var(--ink-2);
  font: 700 12px var(--font); text-align: center; cursor: pointer; }
.more-item.on { background: var(--accent-soft); color: var(--accent-ink); }
.more-item.danger { background: #ffe6ea; color: #c01048; }

/* notifications */
.notifs { display: flex; flex-direction: column; gap: 4px; }
.notifs a { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border-radius: 16px; transition: background-color .2s; }
.notifs a:hover { background: var(--card-2); }
.notifs li.unread a { background: var(--accent-softer); }
.notif-txt { flex: 1; min-width: 0; font-size: 14px; line-height: 1.7; }
.notif-txt q { color: var(--ink-2); }
.notif-txt small { display: block; color: var(--ink-3); font-size: 12px; }
