/* ==========================================================================
   Teacher Portal - Loyola College, Bopitiya
   Navy + crimson from the college crest. Mobile first; sidebar from 960px.
   Light/dark follow the device setting.
   ========================================================================== */
:root {
  --navy: #1b2a5e; --navy-2: #2a3f8f; --navy-soft: #eef1fb;
  --crimson: #c8102e; --crimson-soft: #fdecef; --gold: #d4a017;
  --bg: #f3f5fa; --card: #ffffff; --card-2: #f8f9fd; --border: #e3e7f1;
  --text: #121a33; --muted: #66708a; --faint: #9aa3b8;
  --ok: #0f9d6b; --ok-soft: #e7f7f0; --warn: #c26a00; --warn-soft: #fff4e5; --bad: #d42a2a; --bad-soft: #fdecec;
  --info: #2563eb; --info-soft: #eaf1ff;
  --shadow: 0 1px 2px rgba(18,26,51,.05), 0 4px 16px rgba(18,26,51,.06);
  --shadow-lg: 0 10px 30px rgba(27,42,94,.18);
  --radius: 16px; --radius-sm: 10px;
  --g-aplus: #0f9d6b; --g-a: #22b07d; --g-b: #2563eb; --g-c: #c26a00; --g-s: #e07b39; --g-w: #d42a2a; --g-ab: #66708a; --g-ex: #7c3aed;
}
@media (prefers-color-scheme: dark) {
  :root {
    --navy-soft: #1a2342; --crimson-soft: #3a1520;
    --bg: #0b1020; --card: #131a2e; --card-2: #182039; --border: #232c48;
    --text: #e8ecf7; --muted: #95a0bd; --faint: #6b7594;
    --ok-soft: #0f2e25; --warn-soft: #33240c; --bad-soft: #3a1717; --info-soft: #14223f;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 15px;
       background: var(--bg); color: var(--text); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--navy-2); text-decoration: none; }
@media (prefers-color-scheme: dark) { a { color: #8fa6ff; } }
h1 { font-size: 22px; line-height: 1.25; margin: 0; font-weight: 800; letter-spacing: -.2px; }
h2 { font-size: 16px; margin: 0; font-weight: 800; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }

/* ---------------- App shell ---------------- */
.side { display: none; }
.mtop { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
        padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
        background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #fff; box-shadow: 0 2px 12px rgba(27,42,94,.25); }
.mtop img { width: 34px; height: 38px; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0,0,0,.25)); }
.mtop .t { flex: 1; min-width: 0; }
.mtop .t b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mtop .t small { display: block; font-size: 11px; opacity: .8; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
          background: linear-gradient(135deg, var(--crimson), #e2483f); color: #fff; font-weight: 800; font-size: 13px;
          border: 2px solid rgba(255,255,255,.6); }
.main { padding: 16px 16px 100px; max-width: 1180px; margin: 0 auto; }
.focus .main { padding-bottom: 110px; }

.bnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around;
        background: var(--card); border-top: 1px solid var(--border); padding: 6px 4px; padding-bottom: max(6px, env(safe-area-inset-bottom));
        box-shadow: 0 -6px 20px rgba(18,26,51,.06); }
.bnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 12px;
          color: var(--faint); font-size: 11px; font-weight: 700; }
.bnav a i { font-size: 18px; }
.bnav a.on { color: var(--navy-2); background: var(--navy-soft); }
@media (prefers-color-scheme: dark) { .bnav a.on { color: #a9b9ff; } }
.focus .bnav { display: none; }

@media (min-width: 960px) {
  .mtop, .bnav { display: none; }
  .app { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
  .side { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
          background: linear-gradient(180deg, var(--navy) 0%, #142049 100%); color: #dfe5ff; padding: 22px 16px; }
  .side .crest { text-align: center; padding: 6px 0 18px; border-bottom: 1px solid rgba(255,255,255,.1); }
  .side .crest img { width: 74px; height: 84px; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(0,0,0,.35)); }
  .side .crest b { display: block; margin-top: 8px; color: #fff; font-size: 16px; }
  .side .crest small { display: block; font-size: 11px; opacity: .7; letter-spacing: .3px; }
  .side nav { flex: 1; padding-top: 16px; display: flex; flex-direction: column; gap: 4px; }
  .side nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; color: #c7cff2; font-weight: 600; font-size: 14px; }
  .side nav a i { width: 18px; text-align: center; opacity: .9; }
  .side nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
  .side nav a.on { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 3px 0 0 var(--crimson); }
  .side .me { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.06); }
  .side .me .avatar { border-color: rgba(255,255,255,.3); }
  .side .me div { flex: 1; min-width: 0; }
  .side .me b { display: block; color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side .me small { display: block; font-size: 11px; opacity: .7; }
  .side .me button { background: none; border: 0; color: #c7cff2; cursor: pointer; font-size: 16px; padding: 6px; }
  .side .me button:hover { color: #fff; }
  .main { padding: 28px 32px 48px; }
  .focus .main { padding-bottom: 110px; }
}

/* ---------------- Building blocks ---------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--muted); }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 12px; }
.section-title h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.section-title a { font-size: 13px; font-weight: 700; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card { margin-top: 12px; }
.card.flush { padding: 0; overflow: hidden; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-h h2 { font-size: 15px; }

.grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px)  { .grid.g2, .grid.g3 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .grid.g3 { grid-template-columns: 1fr 1fr 1fr; } }
.cols { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 1100px) { .cols { grid-template-columns: 1.6fr 1fr; align-items: start; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 12px 18px;
       font: inherit; font-weight: 800; font-size: 14px; cursor: pointer; background: var(--navy-2); color: #fff; box-shadow: 0 4px 12px rgba(42,63,143,.25); }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.ghost { background: var(--card); color: var(--text); border: 1px solid var(--border); box-shadow: none; }
.btn.red { background: var(--crimson); box-shadow: 0 4px 12px rgba(200,16,46,.25); }
.btn.sm { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }

label.f { display: block; font-size: 13px; font-weight: 700; margin: 14px 0 6px; }
.in { width: 100%; padding: 12px 14px; font: inherit; font-size: 16px; color: var(--text); background: var(--card);
      border: 1.5px solid var(--border); border-radius: 12px; transition: border-color .15s, box-shadow .15s; }
.in:focus { outline: none; border-color: var(--navy-2); box-shadow: 0 0 0 4px rgba(42,63,143,.15); }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.in-icon { position: relative; }
.in-icon i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.in-icon .in { padding-left: 40px; }

.flash { display: flex; gap: 10px; align-items: flex-start; border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; font-size: 14px; font-weight: 600; }
.flash i { margin-top: 3px; }
.flash-success { background: var(--ok-soft); color: var(--ok); }
.flash-error   { background: var(--bad-soft); color: var(--bad); }
.flash-info    { background: var(--info-soft); color: var(--info); }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 99px;
        background: var(--card-2); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.navy { background: var(--navy-soft); color: var(--navy-2); }
@media (prefers-color-scheme: dark) { .pill.navy { color: #a9b9ff; } }

/* Grade badges */
.gb { display: inline-grid; place-items: center; min-width: 30px; height: 24px; padding: 0 6px; border-radius: 7px; font-size: 11px; font-weight: 800; color: #fff; }
.gb.g-ap { background: var(--g-aplus); } .gb.g-a { background: var(--g-a); } .gb.g-b { background: var(--g-b); }
.gb.g-c { background: var(--g-c); } .gb.g-s { background: var(--g-s); } .gb.g-w { background: var(--g-w); }
.gb.g-ab { background: var(--g-ab); } .gb.g-ex { background: var(--g-ex); } .gb.g-none { background: transparent; color: var(--faint); border: 1px dashed var(--border); }

/* Segmented term switch */
.seg { display: inline-flex; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 4px; gap: 4px; box-shadow: var(--shadow); }
.seg a { padding: 8px 16px; border-radius: 10px; font-weight: 700; font-size: 14px; color: var(--muted); white-space: nowrap; }
.seg a.on { background: var(--navy-2); color: #fff; }
.seg a .fa-lock { font-size: 11px; margin-left: 4px; opacity: .8; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 16px; padding-bottom: 2px; scrollbar-width: none; }
.tabs a { padding: 9px 14px; border-radius: 10px; font-weight: 700; font-size: 14px; color: var(--muted); background: var(--card); border: 1px solid var(--border); white-space: nowrap; }
.tabs a.on { color: var(--navy-2); border-color: var(--navy-2); background: var(--navy-soft); }
@media (prefers-color-scheme: dark) { .tabs a.on { color: #a9b9ff; } }

/* Progress */
.bar { height: 8px; border-radius: 99px; background: var(--card-2); overflow: hidden; border: 1px solid var(--border); }
.bar > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--navy-2), #4a63c9); }
.bar.done > span { background: linear-gradient(90deg, var(--ok), #34c38f); }
.ring { --p: 0; --c: var(--navy-2); width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
        background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--card-2) 0); }
.ring::before { content: ''; grid-area: 1 / 1; width: 50px; height: 50px; border-radius: 50%; background: var(--card); }
.ring b { grid-area: 1 / 1; font-size: 12px; font-weight: 800; position: relative; letter-spacing: -.3px; }
.ring.lg { width: 92px; height: 92px; } .ring.lg::before { width: 74px; height: 74px; } .ring.lg b { font-size: 18px; }

/* Dashboard hero */
.hero { position: relative; overflow: hidden; border-radius: 22px; padding: 22px; color: #fff;
        background: radial-gradient(120% 140% at 100% 0%, #3b55b8 0%, transparent 55%), linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
        box-shadow: var(--shadow-lg); }
.hero::after { content: ''; position: absolute; right: -24px; bottom: -30px; width: 170px; height: 190px; opacity: .1;
               background: url('logo.png') no-repeat center / contain; filter: grayscale(1) brightness(3); }
.hero .hi { font-size: 13px; opacity: .85; font-weight: 600; }
.hero h1 { color: #fff; font-size: 24px; margin: 2px 0 10px; }
.hero .meta { display: flex; flex-wrap: wrap; gap: 8px; position: relative; z-index: 1; }
.hero .meta span { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.18); padding: 6px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.hero .meta .lock { background: rgba(200,16,46,.85); border-color: transparent; }
.term-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 16px 0 4px; }

.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px;
       display: flex; align-items: center; gap: 12px; }
.kpi .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 17px; flex-shrink: 0; }
.kpi .ic.navy { background: var(--navy-soft); color: var(--navy-2); } .kpi .ic.red { background: var(--crimson-soft); color: var(--crimson); }
.kpi .ic.ok { background: var(--ok-soft); color: var(--ok); } .kpi .ic.warn { background: var(--warn-soft); color: var(--warn); }
.kpi b { display: block; font-size: 22px; line-height: 1.1; font-weight: 800; }
.kpi span { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi .ring b { font-size: 12px; line-height: 1; }   /* keep the ring's % small - .kpi b above is for the big numbers */

/* Subject tiles */
.tile { display: block; position: relative; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
        padding: 16px; color: var(--text); transition: transform .12s, box-shadow .12s; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.tile .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tile .cls { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 15px;
             background: var(--navy-soft); color: var(--navy-2); }
@media (prefers-color-scheme: dark) { .tile .cls { color: #a9b9ff; } }
.tile h3 { margin: 12px 0 2px; font-size: 16px; font-weight: 800; }
.tile .s { font-size: 13px; color: var(--muted); }
.tile .bar { margin: 12px 0 6px; }
.tile .f { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-weight: 600; }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list > li, .list > a { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); color: var(--text); }
.list > :last-child { border-bottom: 0; }
.list > a:hover { background: var(--card-2); }
.list .grow { flex: 1; min-width: 0; }
.list .grow b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .grow small { display: block; font-size: 12px; color: var(--muted); }
.list .chev { color: var(--faint); }
.dot { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; font-size: 14px; background: var(--navy-soft); color: var(--navy-2); font-weight: 800; }
.dot.red { background: var(--crimson-soft); color: var(--crimson); } .dot.ok { background: var(--ok-soft); color: var(--ok); }
.medal { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; flex-shrink: 0; }
.medal.m1 { background: linear-gradient(135deg, #f5c542, #d4a017); } .medal.m2 { background: linear-gradient(135deg, #c9d1dc, #98a4b5); }
.medal.m3 { background: linear-gradient(135deg, #e0a074, #b8703f); } .medal.mx { background: var(--card-2); color: var(--muted); }

.empty { text-align: center; padding: 34px 18px; color: var(--muted); }
.empty i { font-size: 34px; color: var(--faint); margin-bottom: 10px; display: block; }
.empty h2 { color: var(--text); margin-bottom: 4px; }

/* Activity timeline */
.tl-day { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 14px 18px 6px; background: var(--card-2); border-bottom: 1px solid var(--border); }
.chg { font-weight: 800; white-space: nowrap; }
.chg s { color: var(--faint); font-weight: 600; text-decoration: none; }
.chg s::after { content: ' \2192 '; color: var(--faint); }

/* ---------------- Marks entry ---------------- */
.mhead { display: flex; align-items: center; gap: 14px; }
.mhead .cls { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; font-size: 17px;
              background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #fff; flex-shrink: 0; box-shadow: var(--shadow-lg); }
.mstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 10px; }
@media (min-width: 700px) { .mstats { grid-template-columns: repeat(6, 1fr); } }
.mstats div { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.mstats b { display: block; font-size: 18px; font-weight: 800; }
.mstats span { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .3px; }
.dist { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--card-2); border: 1px solid var(--border); }
.dist span { height: 100%; transition: width .2s; }
.dist-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 8px 0 14px; font-size: 12px; color: var(--muted); font-weight: 700; }
.dist-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 4px; }
.tools { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.tools .in-icon { flex: 1; min-width: 200px; }
.mlist { list-style: none; margin: 0; padding: 0; }
.mrow { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.mrow:last-child { border-bottom: 0; }
.mrow.hide { display: none; }
.mrow .num { width: 22px; text-align: right; color: var(--faint); font-size: 12px; font-weight: 700; flex-shrink: 0; }
.mrow .who { flex: 1; min-width: 0; }
.mrow .who b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 520px) {   /* phones: full names over two lines, no row numbers - the mark box matters more */
  .mrow { padding: 10px 12px; gap: 8px; }
  .mrow .num { display: none; }
  .mrow .who b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; font-size: 13.5px; }
  .mrow input.mark { width: 62px; }
  .tok { padding: 10px 6px; }
}
.mrow .who small { display: block; font-size: 12px; color: var(--muted); }
.mrow .gb { flex-shrink: 0; }
.mrow input.mark { width: 70px; text-align: center; padding: 10px 4px; font: inherit; font-size: 18px; font-weight: 800; color: var(--text);
                   background: var(--card-2); border: 1.5px solid var(--border); border-radius: 12px; flex-shrink: 0; }
.mrow input.mark:focus { outline: none; border-color: var(--navy-2); background: var(--card); box-shadow: 0 0 0 4px rgba(42,63,143,.15); }
.mrow input.mark.bad { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.mrow input.mark.changed { border-color: var(--gold); }
.mrow input[readonly] { opacity: .75; }
.tok { border: 1.5px solid var(--border); background: var(--card); color: var(--muted); border-radius: 10px; padding: 10px 7px;
       font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; flex-shrink: 0; }
.tok.on { background: var(--navy-2); border-color: var(--navy-2); color: #fff; }
.savebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 12px;
           padding: 12px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom));
           background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--border);
           box-shadow: 0 -8px 24px rgba(18,26,51,.08); }
.savebar .c b { display: block; font-size: 15px; } .savebar .c small { font-size: 12px; color: var(--muted); }
@media (min-width: 960px) { .savebar { left: 264px; } }

/* ---------------- Tables ---------------- */
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; text-align: left; }
.tbl th { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); background: var(--card-2); font-weight: 800; }
.tbl th.sub { text-transform: none; letter-spacing: 0; }
.tbl .c { text-align: center; } .tbl .r { text-align: right; }
.tbl tbody tr:hover { background: var(--card-2); }
.tbl .stick { position: sticky; left: 0; background: var(--card); z-index: 1; box-shadow: 1px 0 0 var(--border); }
.tbl thead .stick { background: var(--card-2); }
.tbl td.low { color: var(--bad); font-weight: 800; }
.tbl td small { display: block; color: var(--muted); font-size: 11px; }

/* Student report */
.sbars { display: flex; flex-direction: column; gap: 10px; }
.sbar { display: grid; grid-template-columns: 130px 1fr 44px; align-items: center; gap: 10px; font-size: 13px; }
.sbar .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.sbar .track { height: 10px; border-radius: 99px; background: var(--card-2); border: 1px solid var(--border); overflow: hidden; }
.sbar .track span { display: block; height: 100%; border-radius: 99px; }
.sbar .v { text-align: right; font-weight: 800; }

/* Profile */
.prof { display: flex; align-items: center; gap: 16px; }
.prof .avatar { width: 64px; height: 64px; font-size: 22px; border: 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; margin-top: 14px; }
.kv dt { color: var(--muted); font-weight: 600; } .kv dd { margin: 0; font-weight: 700; text-align: right; }

/* ---------------- Sign-in screens ---------------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
        background: radial-gradient(80% 60% at 100% 0%, rgba(200,16,46,.25), transparent 60%),
                    radial-gradient(90% 70% at 0% 100%, rgba(59,85,184,.5), transparent 60%),
                    linear-gradient(160deg, #142049, var(--navy) 50%, #0e1736); }
.auth-card { width: 100%; max-width: 410px; background: var(--card); border-radius: 24px; padding: 28px 24px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.auth-card .crest { text-align: center; margin-bottom: 16px; }
.auth-card .crest img { width: 78px; height: 88px; object-fit: contain; }
.auth-card .crest b { display: block; font-size: 20px; margin-top: 8px; }
.auth-card .crest small { display: block; color: var(--muted); font-size: 13px; }
.auth-foot { text-align: center; color: rgba(255,255,255,.65); font-size: 12px; margin-top: 18px; }
.pw-wrap { position: relative; }
.pw-wrap .in { padding-right: 46px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--faint); padding: 10px; cursor: pointer; font-size: 15px; }

/* ---------------- Print (mark sheet / report) ---------------- */
@media print {
  .side, .mtop, .bnav, .savebar, .noprint, .tabs, .seg, .back { display: none !important; }
  .app { display: block; } .main { padding: 0; max-width: none; }
  body { background: #fff; color: #000; font-size: 11px; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .tbl th, .tbl td { padding: 4px 6px; border-bottom: 1px solid #ccc; }
  .tbl .stick { position: static; box-shadow: none; }
  .scroll { overflow: visible; }
  .printhead { display: block !important; margin-bottom: 8px; }
  @page { size: A4 landscape; margin: 10mm; }
}
.printhead { display: none; }
