/* NJHS Service Hours — shared styles */
:root{
  --navy:#1e3a8a; --navy-dark:#172b66; --gold:#d97706; --gold-soft:#fef3c7;
  --bg:#f1f5f9; --card:#ffffff; --ink:#0f172a; --muted:#64748b; --line:#e2e8f0;
  --green:#15803d; --green-soft:#dcfce7; --red:#b91c1c; --red-soft:#fee2e2;
  --blue-soft:#dbeafe;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
*{box-sizing:border-box; margin:0; padding:0; -webkit-tap-highlight-color:transparent;}
html,body{height:100%;}
body{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  background:var(--bg); color:var(--ink); font-size:16px; line-height:1.45;
  -webkit-font-smoothing:antialiased; overscroll-behavior-y:none;
}
#app{max-width:640px; margin:0 auto; min-height:100%; display:flex; flex-direction:column; background:var(--bg);}

/* ---------- chrome ---------- */
.appbar{background:var(--navy); color:#fff; padding:14px 16px calc(14px); position:sticky; top:0; z-index:20;}
.appbar .t{font-weight:700; font-size:17px; display:flex; align-items:center; gap:8px;}
.appbar .s{font-size:12px; opacity:.85; margin-top:2px;}
.appbar.gold{background:var(--gold);}
.back{background:none; border:none; color:#fff; font-size:20px; line-height:1; padding:0 4px 0 0; cursor:pointer;}
.view{flex:1; padding:16px; padding-bottom:calc(24px + var(--safe-b));}
.tabbar{position:sticky; bottom:0; display:flex; background:#fff; border-top:1px solid var(--line); padding-bottom:var(--safe-b); z-index:20;}
.tabbar button{flex:1; background:none; border:none; padding:9px 0 11px; font-size:11px; color:var(--muted); font-family:inherit; cursor:pointer;}
.tabbar button .ic{font-size:19px; display:block; margin-bottom:2px;}
.tabbar button.on{color:var(--navy); font-weight:700;}

/* ---------- primitives ---------- */
.card{background:var(--card); border:1px solid var(--line); border-radius:12px; padding:16px; margin-bottom:14px;}
.card h3{font-size:15px; margin-bottom:10px;}
.btn{display:block; width:100%; text-align:center; background:var(--navy); color:#fff; border:none; border-radius:10px;
     padding:14px; font-size:16px; font-weight:700; font-family:inherit; cursor:pointer; margin-bottom:10px;}
.btn:active{transform:scale(.99);}
.btn:disabled{background:#cbd5e1; color:#64748b; cursor:not-allowed;}
.btn.gold{background:var(--gold);} .btn.green{background:var(--green);} .btn.red{background:var(--red);}
.btn.ghost{background:#fff; color:var(--navy); border:1.5px solid var(--navy);}
.btn.sm{padding:10px; font-size:14px;}
label{display:block; font-size:13px; font-weight:700; color:#334155; margin:14px 0 5px;}
.inp{width:100%; border:1px solid #cbd5e1; border-radius:8px; padding:12px; font-size:16px; font-family:inherit;
     background:#fff; color:var(--ink);}
.inp:focus{outline:2px solid var(--navy); outline-offset:-1px;}
textarea.inp{line-height:1.45; resize:vertical;}
.hint{font-size:12px; color:var(--muted); margin-top:5px;}
.err{background:var(--red-soft); color:var(--red); border-radius:8px; padding:10px 12px; font-size:13px; margin-bottom:12px;}
.grid2{display:flex; gap:10px;} .grid2>*{flex:1;}
.pill{display:inline-block; font-size:11px; font-weight:700; padding:4px 10px; border-radius:999px; white-space:nowrap;}
.pill.green{background:var(--green-soft); color:var(--green);}
.pill.red{background:var(--red-soft); color:var(--red);}
.pill.blue{background:var(--blue-soft); color:var(--navy);}
.pill.gold{background:var(--gold-soft); color:#92400e;}
.muted{color:var(--muted);} .center{text-align:center;}

/* ---------- progress rings ---------- */
.rings{display:flex; gap:12px; margin-bottom:14px;}
.ring-card{flex:1; background:var(--card); border:1px solid var(--line); border-radius:12px; padding:14px 10px; text-align:center;}
.ring{width:104px; height:104px; margin:0 auto 10px; border-radius:50%; display:flex; align-items:center; justify-content:center;}
.ring .inner{width:82px; height:82px; border-radius:50%; background:var(--card); display:flex; flex-direction:column;
             align-items:center; justify-content:center;}
.ring .big{font-size:19px; font-weight:800;} .ring .of{font-size:10px; color:var(--muted);}
.ring-label{font-size:12px; font-weight:700;} .ring-note{font-size:10px; color:var(--muted); margin-top:3px;}

/* ---------- entries ---------- */
.entry{background:var(--card); border:1px solid var(--line); border-radius:12px; padding:14px; margin-bottom:10px;}
.entry .top{display:flex; justify-content:space-between; align-items:flex-start; gap:10px; margin-bottom:4px;}
.entry .name{font-size:14px; font-weight:700;}
.entry .meta{font-size:12px; color:var(--muted); line-height:1.5;}
.linkbtn{background:none; border:none; font-family:inherit; font-size:12px; font-weight:700; cursor:pointer; padding:6px 0 0;}
.linkbtn.del{color:var(--red);} .linkbtn.nav{color:var(--navy);}
.rejectbox{background:var(--red-soft); border-radius:8px; padding:10px; font-size:12px; color:var(--red); margin-top:8px; line-height:1.45;}
.stamp{font-size:11px; color:var(--muted); font-style:italic; margin-top:8px; padding-top:8px; border-top:1px dashed var(--line);}
.stamp b{font-style:normal; color:#334155;}

/* ---------- review workflow ---------- */
.seg{display:flex; background:#e2e8f0; border-radius:10px; padding:3px; margin-bottom:14px;}
.seg button{flex:1; background:none; border:none; font-family:inherit; font-size:13px; font-weight:700; padding:9px 0;
            border-radius:8px; color:var(--muted); cursor:pointer;}
.seg button.on{background:#fff; color:var(--navy); box-shadow:0 1px 2px rgba(15,23,42,.12);}
.srow{display:flex; align-items:center; gap:12px; padding:13px 2px; border-bottom:1px solid var(--line);
      background:none; border-left:none; border-right:none; border-top:none; width:100%; text-align:left;
      font-family:inherit; cursor:pointer;}
.srow:last-child{border-bottom:none;}
.srow .who{flex:1; min-width:0; display:block;}
.srow .nm{font-size:14px; font-weight:700; color:var(--ink); display:block;}
.srow .dt{font-size:12px; color:var(--muted); margin-top:2px; display:block;}
.chev{color:#94a3b8; font-size:16px;}
.srow .rowbtn{background:none; border:none; font-family:inherit; text-align:left; padding:0; cursor:pointer;}
.rowmore{flex:none; background:#fff; border:1px solid var(--line); border-radius:8px; color:var(--muted);
         font-size:17px; line-height:1; padding:7px 11px; cursor:pointer; font-family:inherit;}
.rowmore:active{background:var(--bg);}
.dot{width:10px; height:10px; border-radius:50%; flex:none;}
.dot.g{background:var(--green);} .dot.a{background:var(--gold);} .dot.r{background:var(--red);} .dot.n{background:#cbd5e1;}
.cbx{width:26px; height:26px; border-radius:6px; border:1.5px solid #94a3b8; flex:none; display:flex; align-items:center;
     justify-content:center; font-size:15px; color:#fff; background:#fff; cursor:pointer;}
.cbx.on{background:var(--green); border-color:var(--green);}
.revbar{position:sticky; bottom:0; background:#fff; border-top:1px solid var(--line); padding:12px;
        margin:14px -16px calc(-24px - var(--safe-b)); padding-bottom:calc(12px + var(--safe-b));}
.filterbar{display:flex; gap:7px; margin-bottom:14px; flex-wrap:wrap;}
.chip{font-size:12px; font-weight:700; padding:7px 13px; border-radius:999px; background:#fff; border:1px solid var(--line);
      color:var(--muted); font-family:inherit; cursor:pointer;}
.chip.on{background:var(--navy); color:#fff; border-color:var(--navy);}
.stat-tiles{display:flex; gap:10px; margin-bottom:14px;}
.stat{flex:1; background:var(--card); border:1px solid var(--line); border-radius:12px; padding:12px 8px; text-align:center;}
.stat .n{font-size:22px; font-weight:800;}
.stat .l{font-size:10px; color:var(--muted); text-transform:uppercase; letter-spacing:.03em; margin-top:2px;}
.mini{display:flex; gap:8px; margin-bottom:14px;}
.mini button{flex:1; font-family:inherit; font-size:14px; font-weight:700; padding:11px 0; border-radius:8px;
             border:1.5px solid; background:#fff; cursor:pointer;}
.mini .ok{border-color:var(--green); color:var(--green);}
.mini .ok.on{background:var(--green); color:#fff;}
.mini .no{border-color:var(--red); color:var(--red);}
.mini .no.on{background:var(--red); color:#fff;}

/* ---------- signature ---------- */
.sig{border:1.5px dashed #94a3b8; border-radius:10px; background:#fff; width:100%; height:170px; touch-action:none; display:block;}
.sigrow{display:flex; justify-content:space-between; align-items:center; margin-top:6px;}
.sigimg{width:100%; border:1px solid var(--line); border-radius:8px; background:#fff;}
.banner{background:var(--gold-soft); border-radius:10px; padding:12px; font-size:13px; color:#92400e; margin-bottom:14px; line-height:1.45;}
.summary{background:var(--blue-soft); border-radius:10px; padding:12px; font-size:13px; line-height:1.6; margin-bottom:4px;}

/* ---------- misc ---------- */
.code{font-size:34px; letter-spacing:7px; font-weight:800; color:var(--navy); text-align:center; padding:12px 0 6px;}
.bar{height:7px; border-radius:4px; background:#e2e8f0; overflow:hidden; margin-top:4px;}
.bar i{display:block; height:100%; border-radius:4px;}
.empty{text-align:center; color:var(--muted); font-size:14px; padding:40px 20px; line-height:1.6;}
.spinner{width:34px; height:34px; border:3px solid var(--line); border-top-color:var(--navy); border-radius:50%;
         animation:spin .8s linear infinite; margin:40px auto;}
@keyframes spin{to{transform:rotate(360deg);}}
.toast{position:fixed; left:50%; bottom:calc(80px + var(--safe-b)); transform:translateX(-50%); background:var(--ink); color:#fff;
       padding:12px 18px; border-radius:10px; font-size:14px; z-index:100; max-width:88%; text-align:center;
       box-shadow:0 8px 24px rgba(15,23,42,.25);}
.demo-badge{background:var(--gold); color:#fff; text-align:center; font-size:12px; font-weight:700; padding:6px;}
.google-btn{display:flex; align-items:center; justify-content:center; gap:10px; background:#fff; border:1px solid #cbd5e1;
            border-radius:10px; padding:14px; font-size:16px; font-weight:600; color:#334155; width:100%;
            font-family:inherit; cursor:pointer; margin-bottom:10px;}
.g span:nth-child(1){color:#4285F4;} .g span:nth-child(2){color:#EA4335;} .g span:nth-child(3){color:#FBBC05;}
.g span:nth-child(4){color:#4285F4;} .g span:nth-child(5){color:#34A853;} .g span:nth-child(6){color:#EA4335;}
.g{font-weight:800; font-size:18px;}
@media (min-width:640px){ #app{box-shadow:0 0 40px rgba(15,23,42,.08);} }

/* ---------- attendance: projection ---------- */
.project{position:fixed; inset:0; background:var(--navy); color:#fff; display:flex; flex-direction:column; z-index:50;}
.project-top{display:flex; justify-content:space-between; align-items:center; gap:10px; padding:12px 16px;
             font-size:13px; opacity:.85; flex:none;}
.project-body{flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:10px; text-align:center;}
.project-label{font-size:clamp(14px,2.6vw,26px); letter-spacing:.08em; text-transform:uppercase; opacity:.8;}
.project-code{font-size:clamp(64px,19vw,260px); font-weight:800; letter-spacing:.08em; line-height:1.05; margin:2vh 0;
              font-variant-ligatures:none;}
.project-timer{font-size:clamp(30px,7vw,90px); font-weight:700; opacity:.95; font-variant-numeric:tabular-nums;}
.project-count{font-size:clamp(14px,2.4vw,24px); opacity:.85; margin-top:2vh;}
.project-count b{font-size:1.5em;}
.project-actions{flex:none; padding:16px; padding-bottom:calc(16px + var(--safe-b));}

/* ---------- attendance: roster grid ---------- */
.gridwrap{overflow-x:auto; -webkit-overflow-scrolling:touch; border:1px solid var(--line); border-radius:12px; background:#fff;}
table.grid{border-collapse:separate; border-spacing:0; font-size:12px; width:auto; min-width:100%;}
table.grid th{position:sticky; top:0; background:#f8fafc; z-index:2; padding:9px 8px; text-align:center;
              font-size:10.5px; white-space:nowrap; border-bottom:1px solid var(--line); color:var(--muted);}
table.grid th.focus{background:var(--blue-soft); color:var(--navy);}
table.grid th.stick, table.grid td.stick{position:sticky; left:0; background:#fff; z-index:3; text-align:left;
              min-width:132px; border-right:1px solid var(--line); padding:9px 10px;}
table.grid th.stick{background:#f8fafc; z-index:4;}
table.grid td{padding:0; border-bottom:1px solid var(--line);}
.gname{display:block; font-weight:700; font-size:12.5px; color:var(--ink);}
.gsub{display:block; font-size:10px; color:var(--muted); margin-top:1px;}
.gsub.over{color:var(--red); font-weight:700;}
td.cell{text-align:center; font-weight:800; font-size:13px; cursor:pointer; min-width:46px; height:42px;}
td.cell.present{background:var(--green-soft); color:var(--green);}
td.cell.absent{background:var(--red-soft); color:var(--red);}
td.cell.excused{background:var(--blue-soft); color:var(--navy);}
td.cell.challenged{background:var(--gold-soft); color:#92400e;}
td.cell.na{color:#cbd5e1; cursor:default;}
td.cell:active{outline:2px solid var(--navy); outline-offset:-2px;}

/* ---------- attendance: student prompt ---------- */
.modal-back{position:fixed; inset:0; background:rgba(15,23,42,.55); display:flex; align-items:flex-end;
            justify-content:center; z-index:60; padding:14px; padding-bottom:calc(14px + var(--safe-b));}
.modal{background:#fff; border-radius:16px; padding:20px; width:100%; max-width:460px;
       box-shadow:0 18px 50px rgba(15,23,42,.3); animation:rise .18s ease-out;}
.modal h3{font-size:17px;}
@keyframes rise{from{transform:translateY(14px); opacity:0;} to{transform:translateY(0); opacity:1;}}
@media (min-width:640px){ .modal-back{align-items:center;} }

.evidence{width:100%; border-radius:10px; border:1px solid var(--line); margin-top:10px; display:block;}
