@import url(/fonts/fonts.css);
:root {
  --ink: #1C1917; --muted: #6B6459; --line: #EDE7D9; --bg: #FFFBEB; --card: #fff;
  --yellow: #FFD60A; --yellow-2: #FFE566; --yellow-soft: #FFF6C7; --yellow-ink: #5B4500;
  --green: #16A34A; --green-2: #22C55E; --green-dark: #14532D; --green-soft: #DCFCE7;
  --blue: #2563EB; --blue-soft: #DBEAFE; --pink: #DB2777; --pink-soft: #FCE7F3; --orange: #EA580C; --orange-soft: #FFEDD5;
  --purple: #7C3AED; --purple-soft: #EDE9FE; --teal: #0D9488; --teal-soft: #CCFBF1; --red: #DC2626; --red-soft: #FEE2E2; --grey-soft: #F5F5F4;
  --radius: 16px; --shadow: 0 1px 2px rgba(28,25,23,.06), 0 4px 14px rgba(28,25,23,.05);
  font-family: Poppins, 'Nirmala UI', 'Noto Sans Telugu', 'Noto Sans Devanagari', 'Segoe UI', system-ui, sans-serif;
}
* { box-sizing: border-box }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-size: 14.5px }
button, input, select, textarea { font: inherit; color: inherit }
button { cursor: pointer }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, textarea:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px }
a { color: var(--green) }
h1, h2, h3 { margin: 0; line-height: 1.25 }
h1 { font-size: 24px; font-weight: 800 } h2 { font-size: 19px; font-weight: 700 } h3 { font-size: 15.5px; font-weight: 700 }
.hidden { display: none !important }

/* ---------- shell ---------- */
#app { min-height: 100vh; display: flex }
.side { width: 232px; flex-shrink: 0; background: var(--yellow); display: flex; flex-direction: column; padding: 16px 12px; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto }
.brandrow { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px }
.logo { width: 42px; height: 42px; border-radius: 13px; background: var(--ink); color: var(--yellow); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 19px; flex-shrink: 0; letter-spacing: -1px }
.logo i { font-style: normal; color: var(--green-2) }
.brand b { display: block; font-size: 17px; line-height: 1.1; font-weight: 800 } .brand span { font-size: 11.5px; color: var(--yellow-ink); font-weight: 600 }
.nav { display: flex; flex-direction: column; gap: 3px }
.nav button { border: 0; background: transparent; border-radius: 12px; padding: 10px 12px; font-weight: 600; font-size: 14.5px; text-align: left; display: flex; align-items: center; gap: 10px; color: var(--ink) }
.nav button .ic { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.55); font-size: 16px }
.nav button:hover { background: rgba(255,255,255,.45) }
.nav button.on { background: var(--ink); color: #fff } .nav button.on .ic { background: var(--green-2) }
.nav .badge { margin-left: auto; background: var(--red); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px }
.side .foot { margin-top: auto; padding: 10px 8px 0; font-size: 12px; color: var(--yellow-ink) }
.body { flex: 1; min-width: 0; display: flex; flex-direction: column }
.topbar { display: flex; align-items: center; gap: 10px; padding: 14px 22px; flex-wrap: wrap }
.topbar .title { flex: 1; min-width: 0 } .topbar .title .sub { color: var(--muted); font-size: 13px }
.topbar .right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap }
main { flex: 1; padding: 4px 22px 28px; display: flex; flex-direction: column; gap: 16px; min-width: 0 }
.menu-btn { display: none }

@media (max-width: 1000px) {
  #app { flex-direction: column }
  .side { position: fixed; inset: 0 auto 0 0; z-index: 40; transform: translateX(-105%); transition: transform .2s; box-shadow: 8px 0 30px rgba(0,0,0,.2) }
  .side.open { transform: none }
  .menu-btn { display: inline-flex }
  .topbar { background: var(--yellow); padding: 10px 14px; position: sticky; top: 0; z-index: 30 }
  main { padding: 12px 12px 90px }
  .bottom-nav { display: flex !important }
}
.show-sm { display: none !important }
@media (max-width: 1000px) { .hide-sm { display: none !important } .show-sm { display: flex !important } }
.bottom-nav { display: none; position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); z-index: 30; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)) }
.bottom-nav button { flex: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted); padding: 4px 0 }
.bottom-nav button .ic { font-size: 20px } .bottom-nav button.on { color: var(--green) }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.25); z-index: 35 }

/* ---------- building blocks ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px }
.card > h3 { margin: 0 0 12px; display: flex; align-items: center; gap: 8px }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap }
.between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap }
.grow { flex: 1; min-width: 0 }
.cols { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start }
.cols > .main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px }
.cols > .side2 { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 16px }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px }
@media (max-width: 760px) { .grid2, .grid3 { grid-template-columns: 1fr } .grid4 { grid-template-columns: repeat(2, minmax(0,1fr)) } }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: #44403C }
label.f small { font-weight: 500; color: var(--muted) }
label.f input, label.f select, label.f textarea, input.in, select.in, textarea.in { border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 15px; font-weight: 500; background: #FFFEF8; width: 100% }
label.f input:focus, input.in:focus, select.in:focus, label.f select:focus, textarea.in:focus, label.f textarea:focus { border-color: var(--green); background: #fff; outline: none }
label.chk { display: flex; gap: 9px; align-items: center; font-size: 14px; font-weight: 600; border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; cursor: pointer }
label.chk input { width: 18px; height: 18px; accent-color: var(--green) }
label.chk.on { border-color: var(--green); background: #F0FDF4 }
label.chk small { display: block; font-weight: 500; color: var(--muted); font-size: 12px }
.btn { border-radius: 12px; padding: 10px 16px; font-weight: 700; font-size: 14px; background: #fff; border: 2px solid var(--line); display: inline-flex; align-items: center; gap: 7px; justify-content: center; white-space: nowrap }
a.btn { text-decoration: none; color: inherit }
.btn:hover { border-color: #D6CFBF }
.btn.dark { background: var(--ink); color: var(--yellow); border-color: var(--ink) }
.btn.go { background: var(--green); color: #fff; border-color: var(--green) } .btn.go:hover { background: #15803D }
.btn.yellow { background: var(--yellow); border-color: var(--yellow); color: var(--ink) }
.btn.red { background: var(--red); color: #fff; border-color: var(--red) }
.btn.ghost { background: transparent; border-color: transparent }
.btn.small { padding: 6px 11px; font-size: 13px; border-radius: 10px }
.btn.big { padding: 14px 20px; font-size: 16px }
.btn:disabled { opacity: .5; cursor: not-allowed }
.chips { display: flex; gap: 6px; flex-wrap: wrap }
.chip { border: 2px solid var(--line); border-radius: 999px; padding: 6px 13px; font-weight: 600; font-size: 13px; background: #fff }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink) }
.note { font-size: 13px; color: var(--muted) }
.banner { border-radius: 12px; padding: 10px 14px; font-size: 13.5px; font-weight: 600 }
.banner.ok { background: var(--green-soft); color: var(--green-dark) } .banner.warn { background: var(--yellow-soft); color: var(--yellow-ink) } .banner.bad { background: var(--red-soft); color: #7F1D1D } .banner.info { background: var(--blue-soft); color: #1E3A8A }
.pill { border-radius: 999px; padding: 4px 11px; font-size: 12.5px; font-weight: 700; background: var(--grey-soft); white-space: nowrap; display: inline-flex; gap: 5px; align-items: center }
.pill.ok { background: var(--green-soft); color: var(--green-dark) } .pill.warn { background: var(--yellow-soft); color: var(--yellow-ink) } .pill.bad { background: var(--red-soft); color: #991B1B } .pill.blue { background: var(--blue-soft); color: #1E40AF } .pill.purple { background: var(--purple-soft); color: #5B21B6 } .pill.pink { background: var(--pink-soft); color: #9D174D } .pill.orange { background: var(--orange-soft); color: #9A3412 }
.sub { font-size: 12.5px; color: var(--muted) }
.code { display: inline-block; border-radius: 8px; padding: 2px 8px; font-size: 12px; font-weight: 700; background: var(--yellow-soft); color: var(--yellow-ink) }
.av { width: 38px; height: 38px; border-radius: 12px; background: var(--green-soft); color: var(--green-dark); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0; overflow: hidden; font-size: 15px }
.av img { width: 100%; height: 100%; object-fit: cover }
.av.big { width: 72px; height: 72px; border-radius: 20px; font-size: 28px }
.empty { text-align: center; padding: 34px 16px; color: var(--muted) } .empty .big { font-size: 40px }
.steps { display: flex; gap: 6px; flex-wrap: wrap }
.step { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: #fff; border: 2px solid var(--line); font-weight: 600; font-size: 13px }
.step b { width: 22px; height: 22px; border-radius: 50%; background: var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 12px }
.step.done { border-color: var(--green); background: #F0FDF4 } .step.done b { background: var(--green); color: #fff }
.step.now { border-color: var(--ink); background: var(--yellow-soft) } .step.now b { background: var(--ink); color: var(--yellow) }

/* stat tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px }
.tile { border-radius: var(--radius); padding: 14px 16px; background: #fff; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; border: 0; text-align: left; position: relative; overflow: hidden }
.tile .k { font-size: 12.5px; font-weight: 600; color: var(--muted) } .tile .v { font-size: 26px; font-weight: 800 } .tile .s { font-size: 12px; color: var(--muted) }
.tile .em { position: absolute; right: 12px; top: 10px; font-size: 22px; opacity: .9 }
.tile.green { background: var(--green-soft) } .tile.green .v { color: var(--green-dark) }
.tile.yellow { background: var(--yellow-soft) } .tile.yellow .v { color: var(--yellow-ink) }
.tile.blue { background: var(--blue-soft) } .tile.blue .v { color: #1E3A8A }
.tile.pink { background: var(--pink-soft) } .tile.pink .v { color: #9D174D }
.tile.orange { background: var(--orange-soft) } .tile.orange .v { color: #9A3412 }
.tile.purple { background: var(--purple-soft) } .tile.purple .v { color: #5B21B6 }
.tile.red { background: var(--red-soft) } .tile.red .v { color: #991B1B }
.tile.teal { background: var(--teal-soft) } .tile.teal .v { color: #115E59 }
button.tile { cursor: pointer } button.tile:hover { filter: brightness(.98) }

/* tables & lists */
.tbl-wrap { overflow-x: auto; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow) }
table.t { width: 100%; border-collapse: collapse; font-size: 14px }
table.t th { background: #FFF8DB; color: var(--yellow-ink); text-align: left; padding: 10px 12px; font-weight: 700; white-space: nowrap; position: sticky; top: 0; font-size: 12.5px; text-transform: uppercase; letter-spacing: .02em }
table.t td { padding: 10px 12px; border-bottom: 1px solid #F3EEE2; vertical-align: middle }
table.t tr:last-child td { border-bottom: 0 }
table.t tr.click { cursor: pointer } table.t tr.click:hover td { background: #FFFDF2 }
table.t td.num, table.t th.num { text-align: right; white-space: nowrap }
table.t tfoot td { font-weight: 800; background: #FFFBEA }
.list { display: flex; flex-direction: column }
.li { display: flex; gap: 12px; align-items: center; padding: 10px 4px; border-bottom: 1px solid #F3EEE2 } .li:last-child { border-bottom: 0 }
.li.click { cursor: pointer; border-radius: 12px; padding: 10px 8px } .li.click:hover { background: #FFFDF2 }

/* attendance register */
.reg { border-collapse: separate; border-spacing: 2px; font-size: 12px }
.reg th { font-weight: 600; color: var(--muted); padding: 3px 2px; text-align: center; min-width: 26px }
.reg th.we { color: var(--red) }
.reg td.nm { position: sticky; left: 0; background: #fff; padding: 4px 10px 4px 4px; white-space: nowrap; font-weight: 600; z-index: 1 }
.reg td.c { width: 28px; height: 28px; text-align: center; border-radius: 7px; font-weight: 700; cursor: pointer; font-size: 11px }
.reg td.sum { padding: 0 6px; text-align: right; white-space: nowrap; font-weight: 600 }
.s-P { background: var(--green-soft); color: var(--green-dark) } .s-HD { background: #FEF3C7; color: #92400E } .s-A { background: var(--red-soft); color: #991B1B }
.s-WO { background: var(--grey-soft); color: #78716C } .s-H { background: var(--purple-soft); color: #5B21B6 } .s-L, .s-LH { background: var(--blue-soft); color: #1E40AF }
.s-LWP { background: #E7E5E4; color: #44403C } .s-WOP, .s-HP { background: var(--teal-soft); color: #115E59 } .s-MP { background: var(--orange-soft); color: #9A3412 }
.s-IN { background: var(--green-2); color: #fff } .s-NOT_IN { background: #fff; color: #A8A29E; border: 1px dashed #D6D3D1 } .s-NJ, .s-- { background: transparent; color: #D6D3D1 }
td.c.late { box-shadow: inset 0 -3px 0 var(--orange) } td.c.ov { outline: 2px solid var(--ink); outline-offset: -2px }
.legend { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px } .legend span { border-radius: 6px; padding: 2px 7px; font-weight: 600 }

/* calendar (one person) */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px }
.cal .dh { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted) }
.cal .d { border-radius: 12px; padding: 6px 7px; min-height: 64px; font-size: 11.5px; display: flex; flex-direction: column; gap: 2px; cursor: pointer; border: 2px solid transparent }
.cal .d b { font-size: 14px } .cal .d:hover { border-color: var(--ink) }

/* bars */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding-top: 10px }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; font-size: 11.5px; color: var(--muted) }
.bars .bar i { display: block; width: 100%; max-width: 38px; border-radius: 10px 10px 4px 4px; background: linear-gradient(180deg, var(--green-2), var(--green)) }
.bars .bar.today i { background: linear-gradient(180deg, var(--yellow-2), #E0B800) }
.bars .bar b { color: var(--ink); font-size: 12px }

/* login & pin */
.center { min-height: 100vh; width: 100%; display: flex; align-items: center; justify-content: center; padding: 22px; background: radial-gradient(circle at 15% 10%, var(--yellow-2), transparent 40%), radial-gradient(circle at 85% 90%, #BBF7D0, transparent 45%), var(--bg) }
.users { display: flex; flex-wrap: wrap; gap: 10px }
.user { border: 2px solid var(--line); background: #fff; border-radius: 14px; padding: 12px 16px; font-weight: 700; font-size: 15px; min-width: 140px; text-align: left; display: flex; gap: 10px; align-items: center }
.user small { display: block; font-weight: 500; color: var(--muted); font-size: 12px }
.user.sel { border-color: var(--green); background: #F0FDF4 }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 320px; margin: 0 auto }
.pinpad button { border: 0; border-radius: 16px; background: #fff; box-shadow: var(--shadow); font-size: 24px; font-weight: 700; padding: 16px 0 }
.pinpad button:active { background: var(--yellow-soft) }
.pinpad button.ok { background: var(--green); color: #fff } .pinpad button.clr { background: var(--grey-soft); font-size: 16px }
.dots { display: flex; justify-content: center; gap: 12px; margin: 6px 0 14px }
.dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ink) } .dots i.on { background: var(--ink) }

/* modal & toast */
.modal-bg { position: fixed; inset: 0; background: rgba(28,25,23,.45); display: flex; align-items: flex-start; justify-content: center; padding: 40px 14px; z-index: 50; overflow-y: auto }
.modal { background: #fff; color: var(--ink); border-radius: 20px; padding: 20px 22px; width: min(560px, 100%); display: flex; flex-direction: column; gap: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.25) }
.modal.wide { width: min(940px, 100%) }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 14px; font-weight: 600; z-index: 60; box-shadow: 0 10px 30px rgba(0,0,0,.3); max-width: 92vw }
.toast.ok { background: var(--green) } .toast.bad { background: var(--red) }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); flex-wrap: wrap }
.tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; font-size: 14px }
.tabs button.on { color: var(--ink); border-color: var(--green) }
.money-big { font-size: 30px; font-weight: 800 }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px } .kv span { color: var(--muted) }
.cam { position: relative; border-radius: 18px; overflow: hidden; background: #111; aspect-ratio: 4/3; width: 100% }
.cam video, .cam img { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1) }
.cam .ring { position: absolute; inset: 14%; border: 4px dashed rgba(255,214,10,.9); border-radius: 50% }
.cam .msg { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px; background: rgba(0,0,0,.55); color: #fff; text-align: center; font-weight: 600 }
.setcols { display: flex; gap: 16px; align-items: flex-start }
.setmenu { flex: 0 0 250px; padding: 8px; position: sticky; top: 10px }
@media (max-width: 760px) { .setcols { flex-direction: column; align-items: stretch } .setmenu { flex: none; position: static } .setmenu .nav { flex-direction: row; overflow-x: auto } .setmenu .nav button { white-space: nowrap } }
.qrbox svg { width: 100%; height: auto; display: block }
@media print { .side, .topbar, .bottom-nav, .noprint { display: none !important } main { padding: 0 } }
