/* App frame: top bar and menu, bottom nav, bottom-sheet dialogs, the
   message bar (toast), receipt viewer, and the sign-in / loading screens.
   (Their animations are in motion.css.) */

/* header */
.topbar{
  position:sticky; top:0; z-index:20;
  background:var(--paper); padding:calc(10px + env(safe-area-inset-top)) 0 8px;
  border-bottom:1px solid var(--line);
}
.topbar-row{display:flex; align-items:center; gap:10px;}
.topbar h1{font-size:21px; flex:1; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.sync-dot{width:8px; height:8px; border-radius:50%; background:var(--gold); display:inline-block; margin-right:6px; transition:background .2s;}
.sync-dot.live{background:var(--pine-2);}
.sync-label{font-size:12px; color:var(--muted); display:flex; align-items:center;}

.menu-btn{
  flex-shrink:0; background:none; border:1px solid var(--line); border-radius:10px;
  width:42px; height:38px; display:flex; align-items:center; justify-content:center; color:var(--ink);
}
/* lit while you're on a page that's reached from the menu */
.menu-btn.active{background:var(--pine); border-color:var(--pine); color:var(--white);}

/* menu sheet (see the desktop file for the sidebar version) */
.bottom-nav .desk-only{display:none;}
.menu-who{display:flex; align-items:center; gap:12px; padding:0 2px 16px;}
.menu-avatar{
  width:42px; height:42px; border-radius:50%; background:var(--pine); color:var(--white); flex-shrink:0;
  display:inline-flex; align-items:center; justify-content:center; font-weight:800; font-size:17px;
}
.menu-who-sub{font-size:12px; font-weight:600; color:var(--muted);}
.menu-who-name{font-size:17px; font-weight:700; display:flex; align-items:center; gap:8px;}
.menu-role{
  font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.03em;
  color:var(--pine); background:#e3ede9; padding:2px 7px; border-radius:999px;
}
.menu-group{background:var(--white); border:1px solid var(--line); border-radius:14px; overflow:hidden; margin-bottom:12px;}
.menu-group-last{margin:6px 0 0;}
/* each row draws its divider above itself; the first visible one is
   pulled under the group's edge, so no stray line when a row is hidden */
.menu-item{
  display:flex; align-items:center; gap:12px; width:100%; min-height:54px; padding:0 14px; margin-top:-1px;
  background:none; border:none; border-top:1px solid var(--line);
  font-size:16px; font-weight:600; color:var(--ink); text-align:left;
}
.menu-item:active{background:var(--paper-2);}
.menu-item .row-icon{color:var(--pine-2);}
.menu-label{flex:1; min-width:0;}
.menu-chev{width:18px; height:18px; flex-shrink:0; fill:none; stroke:var(--muted); stroke-width:2; stroke-linecap:round; stroke-linejoin:round;}
.menu-count{
  min-width:22px; height:22px; padding:0 7px; border-radius:999px; background:var(--gold); color:var(--white);
  font-size:12px; font-weight:700; line-height:22px; text-align:center;
}
.menu-item.danger, .menu-item.danger .row-icon{color:var(--rust);}

/* full-screen receipt viewer */
.photo-viewer{
  position:fixed; inset:0; z-index:200; background:rgba(10,14,13,.94);
  display:none; flex-direction:column; align-items:center; justify-content:center; padding:20px;
}
.photo-viewer.open{display:flex;}
.photo-viewer img{max-width:100%; max-height:78vh; border-radius:10px; object-fit:contain;}
.photo-viewer-close{
  position:absolute; top:calc(16px + env(safe-area-inset-top)); right:16px; z-index:201;
  background:rgba(255,255,255,.16); border:none; color:#fff; font-size:22px;
  width:40px; height:40px; border-radius:50%; line-height:1;
}
.photo-viewer-download{
  margin-top:18px; background:var(--white); color:var(--ink); font-weight:700;
  padding:11px 22px; border-radius:10px; font-size:14px; border:none;
}

/* bottom nav */
.bottom-nav{
  flex:0 0 auto; z-index:30;
  background:rgba(246,244,238,.92); backdrop-filter:blur(10px);
  border-top:1px solid var(--line);
  padding:8px 16px calc(8px + env(safe-area-inset-bottom));
  display:flex; justify-content:space-around;
}
.nav-btn{
  position:relative; background:none; border:none; display:flex; flex-direction:column; align-items:center; gap:3px;
  color:var(--muted); font-size:11px; font-weight:600; padding:4px 6px; min-width:56px; min-height:46px;
}
.nav-btn .ic{width:24px; height:24px; fill:none; stroke:currentColor; stroke-width:1.75; stroke-linecap:round; stroke-linejoin:round;}
.nav-btn.active{color:var(--pine);}
.nav-btn.active .ic{stroke-width:2.2;}
.nav-badge{
  position:absolute; top:0; left:calc(50% + 6px); min-width:17px; height:17px; padding:0 5px;
  border-radius:999px; background:var(--rust); color:var(--white); font-size:10.5px; font-weight:700;
  line-height:17px; text-align:center; box-shadow:0 0 0 2px var(--paper);
}
.nav-badge.gold{background:var(--gold);}

/* modal */
.modal-bg{
  position:fixed; inset:0; background:rgba(18,32,29,.45); z-index:50;
  display:none; align-items:flex-end;
}
.modal-bg.open{display:flex;}
.modal{
  background:var(--paper); width:100%; border-radius:20px 20px 0 0; padding:20px 18px calc(20px + env(safe-area-inset-bottom));
  max-height:88vh; max-height:calc(var(--app-h, 100dvh) * 0.9); overflow-y:auto;
  overscroll-behavior:contain;
}
.modal-handle{width:36px; height:4px; background:var(--line); border-radius:2px; margin:0 auto 14px;}
.modal-title{font-size:17px; margin-bottom:4px;}

.toast{
  position:fixed; left:50%; transform:translate(-50%, 10px) scale(.98); z-index:60;
  bottom:calc(90px + env(safe-area-inset-bottom));
  display:flex; align-items:center; gap:14px; max-width:calc(100% - 32px);
  background:var(--ink); color:var(--white); padding:11px 16px; border-radius:12px; font-size:14px;
  box-shadow:0 6px 20px rgba(0,0,0,.18);
  opacity:0; pointer-events:none; transition:opacity .22s, transform .3s cubic-bezier(.2, .8, .2, 1);
}
.toast.show{opacity:1; transform:translate(-50%, 0);}
.toast.has-action{pointer-events:auto;}
.toast-action{
  background:none; border:none; color:#9fe0c8; font-weight:800; font-size:14px;
  padding:6px 2px; margin:-6px 0; letter-spacing:.02em; white-space:nowrap;
}
@media (min-width: 900px){
  .toast{bottom:36px;}
}

/* login screen */
.login-screen{
  position:fixed; inset:0; z-index:100; background:var(--paper);
  display:none; align-items:center; justify-content:center; padding:24px;
}
.login-screen.open{display:flex;}
.boot-screen{
  position:fixed; inset:0; z-index:110; background:var(--paper);
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px;
}
.boot-screen.done{display:none;}
.boot-name{font-size:26px; font-weight:800; color:var(--pine);}
.boot-sub{font-size:13px; color:var(--muted);}
.login-card{width:100%; max-width:340px;}
.login-card h1{font-size:28px;}
