/* SEWITech Site Tracker — visual design, taken from the SEWI TECH letterhead:
   amber #FBB230, charcoal #616163, Poppins (text) + Montserrat (headings). */
@font-face { font-family: 'Poppins'; font-weight: 400; font-display: swap; src: url(fonts/poppins-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 500; font-display: swap; src: url(fonts/poppins-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 600; font-display: swap; src: url(fonts/poppins-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 700; font-display: swap; src: url(fonts/poppins-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 600; font-display: swap; src: url(fonts/montserrat-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 700; font-display: swap; src: url(fonts/montserrat-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 800; font-display: swap; src: url(fonts/montserrat-latin-800-normal.woff2) format('woff2'); }
:root {
  --brand: #FBB230; --brand-dark: #e39a12; --brand-ink: #2a2a2b; --accent: #FBB230;
  --char: #616163; --char-dark: #3f3f41; --brand-2: #616163;
  --bg: #f4f4f5; --card: #ffffff; --ink: #2a2a2b; --muted: #6f6f73; --line: #e6e6e8; --soft: #f8f8f9;
  --ok: #17924a; --ok-soft: #e3f6ea; --warn: #b26a00; --warn-soft: #fff3dc; --bad: #c8322b; --bad-soft: #fde6e4;
  --violet: #6b4fd8; --teal: #0e8f8a; --orange: #e0730f; --pink: #c63d7a;
  --radius: 16px; --shadow: 0 1px 2px rgba(30,30,32,.05), 0 6px 18px rgba(30,30,32,.07);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141415; --card: #1f1f21; --ink: #f1f1f2; --muted: #a3a3a8; --char: #8d8d91;
    --line: #2f2f33; --soft: #29292c; --ok-soft: #13341f; --warn-soft: #3a2b0f; --bad-soft: #3b1715;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25); color-scheme: dark;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { background: var(--bg); }
body { margin: 0; font: 15.5px/1.5 "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
svg.i { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* header */
header { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 16px 12px;
  background: #fff; color: var(--char); box-shadow: 0 2px 12px rgba(30,30,32,.06); }
/* the amber + grey rule from the letterhead */
header::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: linear-gradient(90deg, #FBB230 0 50%, #616163 50% 100%); }
.logo { flex: 1; min-width: 0; display: flex; align-items: center; }
.logo img { height: 38px; width: auto; max-width: 100%; }
.brand { flex: 1; min-width: 0; line-height: 1.15; }
.brand b { display: block; font-size: 17px; color: var(--char-dark); }
.brand small { font-size: 12px; color: var(--muted); }
.back { background: var(--soft); color: var(--char-dark); border: 1.5px solid var(--line); width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; padding: 0; cursor: pointer; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 99px; background: var(--ok-soft); color: var(--ok); flex: none; }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge.off { background: var(--bad-soft); color: var(--bad); }
@media (prefers-color-scheme: dark) { header { background: #1f1f21; color: #eee; } .brand b { color: #f1f1f2; } .back { color: #f1f1f2; } }

.syncbar { display: flex; align-items: center; gap: 8px; padding: 10px 16px; font-size: 14px; font-weight: 500; background: var(--warn-soft); color: var(--warn); }
main { max-width: 760px; margin: 0 auto; padding: 16px; }

/* cards & typography */
.card { background: var(--card); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
h1, h2, h3, .brand b, .tile b, .kpi b { font-family: "Montserrat", "Poppins", sans-serif; }
h2 { font-size: 19px; margin: 0 0 6px; font-weight: 700; color: var(--ink); } h3 { font-size: 15px; margin: 18px 0 8px; }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.muted { color: var(--muted); font-size: 13px; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 14px 0 6px; }
input, select, textarea { width: 100%; padding: 13px 14px; font: inherit; color: var(--ink); background: var(--soft); border: 1.5px solid var(--line); border-radius: 12px; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(251,178,48,.25); }
input[type=number] { font-size: 20px; font-weight: 700; }
textarea { min-height: 76px; resize: vertical; }

/* buttons */
button { font: inherit; font-weight: 700; padding: 14px 18px; border: 0; border-radius: 14px; background: var(--brand); color: var(--brand-ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .08s, filter .15s; }
button:active { transform: scale(.98); } button:hover { filter: brightness(1.06); }
button.ghost { background: var(--soft); color: var(--char-dark); border: 1.5px solid var(--line); }
@media (prefers-color-scheme: dark) { button.ghost { color: #f1f1f2; } }
button.small { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
button:disabled { opacity: .5; }
.full { width: 100%; margin-top: 16px; }
.primary { padding: 16px; font-size: 16.5px; box-shadow: 0 6px 16px rgba(251,178,48,.35); letter-spacing: .2px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .row > * { flex: 1; }

/* home */
.hello { background: linear-gradient(135deg, #4a4a4c, #6a6a6d); color: #fff; border-radius: var(--radius); padding: 20px; margin-bottom: 16px; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.hello::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--brand); }
.hello::after { content: ""; position: absolute; right: -6px; bottom: -10px; width: 110px; height: 190px; background: url(logo-mark.png) no-repeat center / contain; opacity: .18; }
.hello .tagline { font-family: "Montserrat", sans-serif; font-weight: 700; font-size: 11px; letter-spacing: 1.2px; color: var(--brand); }
.hello small { opacity: .85; font-size: 13px; } .hello h1 { margin: 4px 0 2px; font-size: 23px; }
.hello .chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; position: relative; z-index: 1; }
.hello .chip { background: rgba(255,255,255,.16); padding: 5px 11px; border-radius: 99px; font-size: 13px; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.hello .chip svg.i { width: 16px; height: 16px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { background: var(--card); border-radius: var(--radius); padding: 18px 16px; text-align: left; color: var(--ink); box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-height: 132px; font-weight: 600; }
.tile .ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: #fff; }
.tile .ico svg.i { width: 26px; height: 26px; }
.tile b { font-size: 16px; } .tile span { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.tile.wide { grid-column: span 2; min-height: auto; flex-direction: row; align-items: center; justify-content: flex-start; }
.c-amber { background: linear-gradient(135deg, #f0a01c, #fcc458); color: #2a2a2b !important; }
.c-char { background: linear-gradient(135deg, #48484a, #77777a); }
.c-green { background: linear-gradient(135deg, #138a43, #3cbf6e); }
.c-gold { background: linear-gradient(135deg, #c27c06, #e9a63a); }
.c-steel { background: linear-gradient(135deg, #34495e, #5d7489); }
.c-rose { background: linear-gradient(135deg, #a8463a, #d57466); }
.c-blue { background: linear-gradient(135deg, #2f6aa3, #5b95cc); }
.tile { border-bottom: 3px solid transparent; } .tile:hover { border-bottom-color: var(--brand); }

/* attendance */
.big2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.big2 button { flex-direction: column; padding: 20px 10px; font-size: 16px; border-radius: 16px; gap: 6px; }
.big2 button svg.i { width: 30px; height: 30px; }
.in { background: linear-gradient(135deg, #138a43, #2fb565); color: #fff; box-shadow: 0 6px 16px rgba(19,138,67,.3); }
.out { background: linear-gradient(135deg, #48484a, #77777a); color: #fff; box-shadow: 0 6px 16px rgba(60,60,62,.3); }

/* category chips */
.chips-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.chips-pick button { background: var(--soft); color: var(--ink); border: 1.5px solid var(--line); flex-direction: column; padding: 12px 6px; font-size: 13px; font-weight: 600; gap: 6px; border-radius: 14px; }
.chips-pick button .e { font-size: 24px; line-height: 1; }
.chips-pick button.on { border-color: var(--brand); background: rgba(251,178,48,.14); color: var(--ink); box-shadow: 0 0 0 3px rgba(251,178,48,.25); }

.photo-btn { width: 100%; margin-top: 14px; padding: 18px; border: 2px dashed var(--line); background: var(--soft); color: var(--muted); border-radius: 14px; }
.preview { width: 100%; max-height: 280px; object-fit: contain; border-radius: 14px; margin-top: 10px; background: #000; }

/* lists */
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.avatar { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; font-size: 15px; }
.thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 12px; background: var(--line); cursor: zoom-in; flex: none; }
.amt { font-weight: 800; white-space: nowrap; font-size: 15px; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 99px; background: var(--soft); color: var(--muted); margin: 4px 4px 0 0; }
.tag.pending { background: var(--warn-soft); color: var(--warn); } .tag.flag { background: var(--bad-soft); color: var(--bad); } .tag.ok { background: var(--ok-soft); color: var(--ok); }
.voided { opacity: .45; } .voided b, .voided .amt { text-decoration: line-through; }
.empty { text-align: center; padding: 22px 10px; color: var(--muted); font-size: 14px; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th { color: var(--muted); font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; }
.scroll { overflow-x: auto; margin: 0 -4px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpi { background: var(--soft); border-radius: 14px; padding: 12px 14px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kpi b { display: block; font-size: 21px; color: var(--ink); margin: 2px 0; letter-spacing: -.3px; }
.site-head { display: flex; align-items: center; gap: 10px; margin: 6px 0 12px; }
.site-head .ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fff; }
.site-head + .kpis { margin-bottom: 4px; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }

/* bottom nav */
nav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; justify-content: center; background: var(--card); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); z-index: 6; box-shadow: 0 -4px 20px rgba(30,30,32,.06); }
nav .inner { display: flex; width: 100%; max-width: 560px; }
nav button { flex: 1; background: none; color: var(--muted); padding: 8px 2px; font-size: 11.5px; font-weight: 600; flex-direction: column; gap: 3px; border-radius: 12px; }
nav button { position: relative; }
nav button.active { color: var(--ink); background: rgba(251,178,48,.16); }
nav button.active svg.i { color: var(--brand-dark); }

/* login */
.login-hero { text-align: center; padding: 28px 10px 18px; }
.login-hero img { width: min(300px, 80%); height: auto; }
.login-hero p { margin: 14px 0 0; color: var(--muted); font-weight: 500; }
@media (prefers-color-scheme: dark) { .login-hero .lgbox { background: #fff; border-radius: 16px; padding: 14px; display: inline-block; } }
.site-foot { text-align: center; font-size: 11.5px; color: var(--muted); margin: 18px 0 4px; }
.site-foot b { font-family: "Montserrat", sans-serif; color: var(--brand-dark); letter-spacing: 1px; }
.lock { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); margin-top: 12px; }
.lock svg.i { width: 15px; height: 15px; }

.hidden { display: none !important; }
dialog { border: 0; padding: 14px; border-radius: 20px; width: min(96vw, 560px); background: var(--card); color: var(--ink); }
dialog::backdrop { background: rgba(5,12,22,.8); }
dialog video { width: 100%; border-radius: 14px; background: #000; margin-bottom: 12px; display: block; }
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #3f3f41; border-left: 4px solid #FBB230; color: #fff; padding: 12px 18px; border-radius: 14px; z-index: 20; max-width: 90vw; font-size: 14px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.25); }

/* password box with show/hide button */
.pwbox { position: relative; }
.pwbox input { padding-right: 52px; }
.pwbox .eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; color: var(--muted); padding: 6px 10px; font-size: 18px; box-shadow: none; }

/* login: choose your group */
.rolepick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 4px; }
.rolepick button { background: var(--soft); color: var(--ink); border: 2px solid var(--line); flex-direction: column; gap: 8px; padding: 14px 6px; font-size: 14px; font-weight: 600; border-radius: 14px; }
.rolepick button .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: #fff; }
.rolepick button.on { border-color: var(--brand); background: rgba(251,178,48,.14); box-shadow: 0 0 0 3px rgba(251,178,48,.25); }

/* dialogs & delete buttons */
.askdlg { max-width: 420px; }
.askdlg .row > button { flex: 1; }
button.danger { background: var(--bad); color: #fff; }
.acts { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.acts .del { color: var(--bad); padding: 6px 10px; }
.rolepick button { line-height: 1.2; text-align: center; }

/* site progress */
.pct { font-family: "Montserrat", sans-serif; font-size: 20px; color: var(--ink); }
.range { width: 100%; accent-color: #FBB230; padding: 0; height: 32px; background: none; border: 0; box-shadow: none; }
.bar { height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; margin: 6px 0; }
.bar.big { height: 14px; }
.bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #f0a01c, #FBB230); border-radius: 99px; transition: width .2s; }
.voice { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.voice button.recording { background: var(--bad); color: #fff; border-color: var(--bad); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .75; } }
audio { width: 100%; max-width: 420px; height: 40px; }
.ph-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ph { position: relative; }
.ph img { width: 76px; height: 76px; object-fit: cover; border-radius: 12px; display: block; }
.ph button { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; padding: 0; border-radius: 50%; background: var(--bad); color: #fff; font-size: 12px; }
.pcard { padding: 14px 0; border-bottom: 1px solid var(--line); }
.pcard:last-child { border-bottom: 0; }
.pcard p { margin: 8px 0 0; }
.pcard .issue { color: var(--warn); }
.vn { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--muted); }
.speak { margin-top: 8px; } .urdu { margin-top: 6px; direction: auto; unicode-bidi: plaintext; }
