/* SG Data — design system */
:root {
  --bg: #f3f5f9; --card: #fff; --text: #111827; --muted: #6b7280; --line: #e5e7eb; --soft: #eef2ff;
  --primary: #1a56db; --primary-dark: #1441a8; --ok: #16a34a; --ok-soft: #dcfce7; --warn: #d97706; --warn-soft: #fef3c7;
  --bad: #dc2626; --bad-soft: #fee2e2; --lock: #9ca3af;
  --r: 12px; --nav-h: 56px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.35 -apple-system, "Segoe UI", Roboto, sans-serif; }
main { padding: 8px 10px calc(var(--nav-h) + 80px); max-width: 640px; margin: 0 auto; }
h1 { margin: 0 0 4px; font-size: 32px; }
h2 { margin: 14px 0 6px; font-size: 13px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
label { display: block; font-size: 14px; color: var(--muted); margin: 6px 0 3px; }
input, select, button { font: inherit; }
input[type=text], input[type=password], input[type=date], input[type=number], input[type=time], input[type=tel], select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); min-height: 40px;
}
input:focus, select:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: transparent; }
svg { width: 22px; height: 22px; fill: currentColor; }
.muted { color: var(--muted); }
.small-text { font-size: 15px; margin: 8px 0 0; }
.msg { min-height: 20px; color: var(--bad); font-size: 16px; }
.empty { color: var(--muted); font-size: 16px; padding: 14px 4px; text-align: center; }

/* header */
.hdr { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 6px; padding: 6px 8px; padding-top: max(6px, env(safe-area-inset-top)); background: var(--primary); color: #fff; min-height: 48px; }
.hdr-btn { background: transparent; border: 0; color: #fff; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.hdr-btn:active { background: rgba(255,255,255,.2); }
.hdr-btn.dark { color: var(--primary); border: 1px solid var(--line); border-radius: 10px; width: 48px; height: 48px; background: #fff; }
.hdr-ctx { flex: 1; min-width: 0; background: transparent; border: 0; color: #fff; text-align: left; padding: 2px 6px; border-radius: 10px; display: flex; flex-direction: column; }
.hdr-ctx:active { background: rgba(255,255,255,.15); }
.hdr-title { font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hdr-sub { font-size: 13px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hdr-sub:not(:empty)::after { content: ' ▾'; }
.badge { background: #f59e0b; color: #111; font-size: 14px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }

/* bottom nav */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.nav button { flex: 1; border: 0; background: transparent; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 0 4px; font-size: 12px; font-weight: 600; position: relative; min-height: var(--nav-h); }
.nav button.on { color: var(--primary); }
.nav button.on svg { transform: translateY(-1px); }
.nav .dot { position: absolute; top: 6px; left: calc(50% + 8px); background: var(--bad); color: #fff; font-size: 12px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px; padding: 0 4px; display: flex; align-items: center; justify-content: center; font-style: normal; }

/* cards, buttons */
.card { background: var(--card); border-radius: var(--r); padding: 10px 12px; box-shadow: 0 1px 2px rgba(0,0,0,.05); margin-bottom: 12px; }
.row { display: flex; gap: 10px; align-items: flex-end; }
.row > input[type=date] { flex: 1; width: auto; min-width: 0; }
.row > .toggle { flex: 0 0 auto; }
.field { flex: 1; min-width: 0; }
.field.small { flex: 0 0 38%; }
.btn { border: 0; border-radius: 10px; padding: 9px 14px; font-weight: 700; color: #fff; background: var(--primary); min-height: 40px; }
.btn:active { filter: brightness(.9); }
.btn:disabled { opacity: .5; }
.btn.big { width: 100%; min-height: 46px; font-size: 17px; margin-top: 10px; }
.btn.ok { background: var(--ok); } .btn.danger { background: var(--bad); } .btn.ghost { background: var(--soft); color: var(--primary); }
.btn.small { padding: 6px 12px; min-height: 36px; font-size: 15px; border-radius: 9px; }
.lnk { color: var(--primary); font-weight: 600; font-size: 15px; background: none; border: 0; padding: 4px 0; }
.toggle { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.toggle button { flex: 1; min-width: 84px; border: 0; background: transparent; padding: 12px 14px; min-height: 48px; color: var(--muted); font-weight: 600; }
.toggle button.on { background: var(--primary); color: #fff; }
.toggle.wide { margin-bottom: 12px; } .toggle.wide button { min-width: 0; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 6px 0; -webkit-overflow-scrolling: touch; }
.chips button { flex: 0 0 auto; border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 999px; padding: 6px 12px; min-height: 34px; font-weight: 600; font-size: 15px; }
.chips button.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.chips button small { display: block; font-weight: 500; font-size: 13px; opacity: .8; }
.seg { display: flex; background: #e9edf5; border-radius: 12px; padding: 4px; margin: 12px 0; gap: 2px; overflow-x: auto; }
.seg button { flex: 1; border: 0; background: transparent; color: var(--muted); padding: 7px 8px; border-radius: 8px; font-weight: 600; font-size: 15px; white-space: nowrap; }
.seg button.on { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.pill { display: inline-block; font-size: 13px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--line); color: var(--text); margin-left: 6px; vertical-align: middle; }
.pill.Draft { background: #e5e7eb; } .pill.Submitted { background: var(--warn-soft); color: #92400e; }
.pill.Approved { background: #dbeafe; color: #1e40af; } .pill.Sent { background: var(--ok-soft); color: #065f46; } .pill.Rejected { background: var(--bad-soft); color: #991b1b; }
.banner { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); color: #9a3412; font-size: 16px; }
.banner.ok { background: #ecfdf5; color: #065f46; } .banner.bad { background: var(--bad-soft); color: #991b1b; }
.chk { display: flex; align-items: center; gap: 6px; font-size: 16px; color: var(--text); margin: 0 0 12px; } .chk input { width: 22px; height: 22px; }

/* login */
.login { text-align: center; margin-top: 12vh; background: var(--card); border-radius: 20px; padding: 28px 20px; }
.logo { width: 64px; height: 64px; border-radius: 18px; background: var(--primary); color: #fff; font-weight: 800; font-size: 30px; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.login input { font-size: 28px; text-align: center; letter-spacing: .3em; margin-top: 16px; min-height: 58px; }

/* NOW card */
.nowcard { background: linear-gradient(135deg, var(--primary), #3b82f6); color: #fff; border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; box-shadow: 0 6px 20px rgba(26,86,219,.25); }
.nowcard.done { background: linear-gradient(135deg, #15803d, #22c55e); box-shadow: 0 6px 20px rgba(22,163,74,.25); }
.nowcard.warn { background: linear-gradient(135deg, #b45309, #f59e0b); box-shadow: 0 6px 20px rgba(217,119,6,.25); }
.nowcard .k { font-size: 13px; opacity: .85; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.nowcard .t { font-size: 21px; font-weight: 800; margin: 2px 0 1px; }
.nowcard .s { font-size: 15px; opacity: .9; }
.nowcard .btn { background: #fff; color: var(--primary); margin-top: 8px; width: 100%; min-height: 40px; font-size: 16px; }
.nowcard.done .btn { color: var(--ok); } .nowcard.warn .btn { color: var(--warn); }
.nowcard .prog { height: 5px; background: rgba(255,255,255,.3); border-radius: 999px; margin-top: 8px; overflow: hidden; }
.nowcard .prog i { display: block; height: 100%; background: #fff; border-radius: 999px; }
.nowcard .meta { display: flex; justify-content: space-between; font-size: 13px; opacity: .9; margin-top: 4px; }

/* timeline */
.tl { position: relative; padding-left: 50px; }
.tl::before { content: ''; position: absolute; left: 40px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.tl-h { position: relative; margin-bottom: 4px; }
.tl-h .time { position: absolute; left: -50px; top: 10px; width: 38px; text-align: right; font-size: 13px; font-weight: 700; color: var(--muted); }
.tl-h .time.now { color: var(--primary); }
.tl-h .dotp { position: absolute; left: -15px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid var(--line); }
.tl-h .dotp.done { background: var(--ok); border-color: var(--ok); }
.tl-h .dotp.now { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 0 4px rgba(26,86,219,.2); }
.tl-h .dotp.warn { background: var(--warn); border-color: var(--warn); }
.tl-h .dotp.lock { background: var(--lock); border-color: var(--lock); }
.tl-h.future { opacity: .55; }
.task { display: flex; align-items: center; gap: 8px; background: var(--card); border-radius: 10px; padding: 7px 10px; margin-bottom: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.05); min-height: 44px; }
.task:active { background: var(--soft); }
.task .ic { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; background: var(--soft); color: var(--primary); }
.task .ic svg { width: 16px; height: 16px; }
.task.done .ic { background: var(--ok-soft); color: var(--ok); }
.task.warn .ic { background: var(--warn-soft); color: var(--warn); }
.task.lock .ic { background: #f3f4f6; color: var(--lock); }
.task .b { flex: 1; min-width: 0; }
.task .n { font-weight: 700; font-size: 16px; }
.task .s { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task.warn .s { color: var(--warn); font-weight: 600; }
.task .v { font-weight: 800; font-size: 17px; flex: 0 0 auto; }
.task .v.ok { color: var(--ok); }
.task .chev { color: #c4c8d0; flex: 0 0 auto; }
.task.sub { min-height: 38px; padding: 5px 10px; margin-left: 8px; }
.task.sub .ic { width: 28px; height: 28px; border-radius: 8px; } .task.sub .ic svg { width: 16px; height: 16px; }
.task.sub .n { font-size: 16px; }
.tl-label { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 10px 0 4px; }
.tl-more { display: block; margin: 4px 0 8px; }

/* entry grid */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.egrid { background: var(--card); border: 0; border-radius: var(--r); padding: 16px 14px; text-align: left; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 1px 2px rgba(0,0,0,.05); min-height: 118px; position: relative; color: var(--text); }
.egrid:active { transform: scale(.98); }
.egrid .ic { width: 40px; height: 40px; border-radius: 12px; background: var(--soft); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.egrid .n { font-weight: 700; font-size: 17px; margin-top: 4px; }
.egrid .s { font-size: 14px; color: var(--muted); }
.egrid .st { position: absolute; top: 12px; right: 12px; font-size: 13px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--line); color: var(--muted); }
.egrid .st.done { background: var(--ok-soft); color: var(--ok); } .egrid .st.warn { background: var(--warn-soft); color: var(--warn); }
.egrid.wide { grid-column: 1 / -1; flex-direction: row; align-items: center; min-height: 72px; }
.egrid.wide .n { margin: 0; }

/* data */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 4px; }
.stat { background: var(--card); border-radius: 10px; padding: 8px 10px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.stat .k { font-size: 13px; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.stat .v { font-size: 21px; font-weight: 800; margin-top: 2px; }
.stat .v small { font-size: 14px; color: var(--muted); font-weight: 600; }
.tbl { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--r); overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.tbl th, .tbl td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.tbl th { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tfoot td { font-weight: 700; border-bottom: 0; background: #fafbfd; }
.tbl tr.filled td:first-child { font-weight: 600; }
.tbl tr[data-tap]:active { background: var(--soft); }
#scr-att .tbl td select, #scr-att .tbl td input { padding: 8px; min-height: 44px; text-align: center; }
#scr-att .tbl td:nth-child(2) { width: 84px; } #scr-att .tbl td:nth-child(3) { width: 96px; }
.slot-table td:first-child { width: 88px; font-weight: 600; }
.slot-table tr.shift-head td { background: var(--soft); color: var(--primary); font-size: 14px; text-transform: uppercase; font-weight: 700; padding: 6px 8px; }
.slot-table input { padding: 6px; min-height: 42px; width: 100%; }
.balance { margin-top: 10px; font-size: 16px; display: flex; gap: 12px; flex-wrap: wrap; } .balance b { font-size: 18px; } .balance .neg { color: var(--bad); }
.list { display: flex; flex-direction: column; gap: 6px; }
.list .item { background: var(--card); border-radius: 10px; padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.list .item .name { font-weight: 600; } .list .item .sub { font-size: 14px; color: var(--muted); } .list .item .val { font-weight: 700; color: var(--ok); }
.actions-inline { display: flex; gap: 6px; }

/* review / dayclose */
.actions { display: flex; gap: 8px; } .actions .btn { flex: 1; margin: 0; }
.flag { font-size: 14px; margin-top: 4px; padding: 4px 8px; border-radius: 8px; }
.flag.block { background: var(--bad-soft); color: #991b1b; } .flag.warn { background: var(--warn-soft); color: #92400e; } .flag.info { background: var(--soft); color: var(--muted); }
.rv-item { background: var(--card); border-radius: 10px; padding: 10px 12px; display: flex; gap: 10px; align-items: flex-start; }
.rv-item input[type=checkbox] { width: 22px; height: 22px; margin-top: 4px; flex: 0 0 auto; }
.rv-item .body { flex: 1; min-width: 0; } .rv-item .title { font-weight: 700; } .rv-item .nums { font-size: 16px; color: var(--muted); }
.rv-item details { margin-top: 4px; font-size: 14px; } .rv-item pre { white-space: pre-wrap; word-break: break-all; margin: 4px 0 0; background: #f3f4f6; padding: 6px; border-radius: 6px; }
.dc-group { background: var(--card); border-radius: var(--r); padding: 10px 12px; margin-bottom: 10px; }
.dc-group h3 { margin: 0 0 6px; font-size: 16px; color: var(--primary); }
.dc-row { padding: 6px 0; border-top: 1px solid var(--line); font-size: 16px; }

/* main tab */
.me { display: flex; gap: 12px; align-items: center; }
.me .av { width: 52px; height: 52px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800; font-size: 23px; display: flex; align-items: center; justify-content: center; }
.me .n { font-weight: 700; font-size: 20px; } .me .s { font-size: 15px; color: var(--muted); }
.menu .task { min-height: 52px; }

/* sticky save */
.sticky-bottom { position: fixed; left: 0; right: 0; bottom: 0; padding: 8px 10px; padding-bottom: max(10px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 30%); z-index: 6; }
.sticky-bottom .btn.big { margin: 0 auto; max-width: 640px; display: block; }
body.has-nav .sticky-bottom { bottom: var(--nav-h); }

/* sheet */
.sheet { position: fixed; inset: 0; z-index: 25; }
.sheet-bg { position: absolute; inset: 0; background: rgba(17,24,39,.45); }
.sheet-body { position: absolute; left: 0; right: 0; bottom: 0; background: var(--card); border-radius: 16px 16px 0 0; padding: 10px 12px max(16px, env(safe-area-inset-bottom)); max-height: 88vh; overflow-y: auto; animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(40px); } to { transform: none; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 20px; }
.bigin { width: 100%; font-size: 30px; font-weight: 800; text-align: center; padding: 8px; min-height: 52px; border: 2px solid var(--line); border-radius: 14px; }
.bigin:focus { border-color: var(--primary); outline: 0; }
.three { display: flex; gap: 8px; } .three .field input { text-align: center; font-size: 25px; font-weight: 700; min-height: 56px; }
.exist { margin-top: 10px; } .exist .item { padding: 8px 10px; }
.hint { font-size: 15px; color: var(--muted); margin: 6px 0 0; } .hint b { color: var(--text); }
.slotpick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.slotpick button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 4px; min-height: 46px; font-weight: 700; color: var(--text); }
.slotpick button small { display: block; font-weight: 600; font-size: 13px; color: var(--muted); }
.slotpick button.done { background: var(--ok-soft); border-color: var(--ok-soft); } .slotpick button.done small { color: var(--ok); }
.slotpick button.now { border-color: var(--primary); color: var(--primary); }
.slotpick button.warn { background: var(--warn-soft); border-color: var(--warn-soft); } .slotpick button.warn small { color: var(--warn); }

/* misc */
.busy { position: fixed; inset: 0; background: rgba(255,255,255,.55); display: flex; align-items: center; justify-content: center; z-index: 30; }
.spinner { width: 40px; height: 40px; border: 4px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px); transform: translateX(-50%); background: #111827; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 16px; z-index: 30; max-width: 90vw; }
.toast.ok { background: var(--ok); } .toast.bad { background: var(--bad); }

/* hour screen */
.hour-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.hour-title { flex: 1; text-align: center; } .hour-title b { display: block; font-size: 20px; } .hour-title span { font-size: 14px; color: var(--muted); }
.hcard { background: var(--card); border-radius: 10px; padding: 6px 10px; margin-bottom: 5px; box-shadow: 0 1px 2px rgba(0,0,0,.05); border-left: 4px solid var(--line); }
.hcard.done { border-left-color: var(--ok); } .hcard.lock { border-left-color: var(--lock); opacity: .7; }
.hcard-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.hcard-h .nm { font-weight: 700; font-size: 15px; } .hcard-h .tick { color: var(--ok); font-weight: 700; }
.hrow { display: flex; gap: 5px; margin-bottom: 4px; }
.hrow select { flex: 1; min-width: 0; padding: 6px 8px; min-height: 38px; font-size: 15px; }
.hrow input { width: 84px; flex: 0 0 auto; padding: 6px; min-height: 38px; text-align: center; font-weight: 700; font-size: 18px; }
.hrow.end input { width: 62px; font-size: 16px; }
.hend { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.hend-h { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.hend-h svg { width: 16px; height: 16px; } .hend-h input { flex: 1; min-height: 34px; padding: 4px 8px; font-weight: 500; }
.hcard .lnk { padding: 2px 0; } .hint.warn { color: var(--warn); }
.line-list .task .v { font-size: 17px; }

/* hour screen: compact line rows + type segment */
.hline { display: flex; align-items: center; gap: 6px; background: var(--card); border-radius: 9px; padding: 5px 8px; margin-bottom: 4px; border-left: 3px solid var(--line); box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.hline.done { border-left-color: var(--ok); } .hline.lock { border-left-color: var(--lock); opacity: .65; } .hline.bad { border-left-color: var(--bad); }
.hline .nm { width: 30%; min-width: 0; font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hline .nm small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }
.hline select { flex: 1; min-width: 0; padding: 5px 6px; min-height: 36px; font-size: 14px; }
.hline input { width: 72px; flex: 0 0 auto; padding: 5px; min-height: 36px; text-align: center; font-weight: 700; font-size: 17px; }
.hline input.sm { width: 56px; font-size: 15px; }
.hline .msg { width: 100%; font-size: 13px; color: var(--bad); }
.hline.warn { border-left-color: var(--warn); } .hline .wchip { color: var(--warn); font-weight: 800; }
.hline.bad { background: var(--bad-soft); } .hline .msg.err { font-weight: 600; }
label.chk { display: flex; align-items: center; gap: 8px; font-size: 15px; text-transform: none; letter-spacing: 0; color: var(--text); margin: 6px 0 2px; } label.chk input { width: 18px; height: 18px; }
.hline.wrap { flex-wrap: wrap; }
.hline .chk-name { width: 100%; display: flex; gap: 6px; align-items: center; }
.hline .chk-name input { flex: 1; width: auto; text-align: left; font-weight: 500; font-size: 15px; min-height: 32px; }
.hlist-hint { font-size: 13px; color: var(--muted); margin: 2px 0 6px; }
.hourly-slot { display: flex; align-items: center; gap: 8px; background: var(--card); border-radius: 10px; padding: 8px 10px; margin-bottom: 5px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.hourly-slot .t { width: 62px; font-weight: 800; font-size: 15px; } .hourly-slot .b { flex: 1; min-width: 0; font-size: 14px; color: var(--muted); }
.hourly-slot .b b { color: var(--text); font-size: 16px; } .hourly-slot .chev { color: #c4c8d0; }
.hourly-slot.next { border: 1px dashed var(--primary); background: var(--soft); }

/* loading bar under the header (reads never block the UI) */
.hdr { position: sticky; }
.hdr-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, transparent, #fff, transparent); background-size: 40% 100%; animation: slide 1s linear infinite; }
@keyframes slide { from { background-position: -40% 0; } to { background-position: 140% 0; } }
/* hour rows: manpower + quick actions */
.hline .mpb { flex: 0 0 auto; font-size: 13px; font-weight: 700; color: var(--muted); background: #f3f4f6; border-radius: 6px; padding: 3px 6px; white-space: nowrap; }
.hline .mpb.chg { color: var(--warn); background: var(--warn-soft); }
.hline .act { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--muted); font-weight: 800; font-size: 16px; padding: 0; }
.hline .act.on { color: var(--primary); }
.hline .nm { width: 27%; }
.hline input { width: 66px; }
.hour-tools { display: flex; gap: 6px; align-items: center; margin: 4px 0 8px; font-size: 14px; color: var(--muted); }
.hour-tools .lnk { padding: 2px 6px; }
.hdone { margin-left: auto; }

/* ---- motion: light, GPU-only ---- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.85); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes tick { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes slideIn { from { transform: translateY(6px); } to { transform: none; } }
.screen.in { animation: slideIn .16s ease-out; }
.tl .task, .hourly-slot, .rv-item, .egrid, .list .item, .hline { animation: fadeUp .22s ease-out both; }
.tl .task:nth-child(2), .hline:nth-child(3) { animation-delay: .03s; }
.tl-h:nth-child(2) .task, .hline:nth-child(4) { animation-delay: .05s; }
.tl-h:nth-child(3) .task, .hline:nth-child(5) { animation-delay: .08s; }
.tl-h:nth-child(4) .task, .hline:nth-child(6) { animation-delay: .11s; }
.tl-h:nth-child(5) .task, .hline:nth-child(7) { animation-delay: .14s; }
.tl-h:nth-child(n+6) .task, .hline:nth-child(n+8) { animation-delay: .17s; }
.task, .egrid, .hourly-slot, .btn, .chips button, .seg button, .nav button svg { transition: transform .12s ease, background-color .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease; }
.task:active, .egrid:active, .hourly-slot:active { transform: scale(.985); }
.btn:active { transform: scale(.97); }
.chips button:active { transform: scale(.94); }
.nav button.on svg { animation: pop .25s ease-out; }
.task.done .ic, .hline.done { animation: tick .25s ease-out; }
.hline { transition: border-color .2s ease, background-color .2s ease; }
.nowcard { transition: background .3s ease, box-shadow .3s ease; }
.nowcard .prog i { transition: width .5s ease; }
.tl-h .dotp { transition: background-color .25s ease, border-color .25s ease, box-shadow .25s ease; }
.toast { animation: fadeUp .18s ease-out; }
.sheet-bg { animation: fadeIn .18s ease-out; } @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.spinner, .hdr-prog { will-change: transform; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---- polish: selects, steppers, SRN picker ---- */
select { -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='%236b7280'><path d='M6 9l6 6 6-6-1.4-1.4L12 12.2 7.4 7.6z'/></svg>"); background-repeat: no-repeat; background-position: right 8px center; padding-right: 28px !important; }
input[type=tel], input[type=text], input[type=number], input[type=time], input[type=date], input[type=password], select { border-radius: 10px; }
input:focus, select:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,219,.15); }
.step { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.step button { width: 36px; min-height: 40px; border: 0; background: #f3f4f6; color: var(--primary); font-size: 23px; font-weight: 800; padding: 0; }
.step button:active { background: var(--soft); }
.step input { border: 0 !important; border-radius: 0 !important; width: 58px; min-height: 40px; text-align: center; font-weight: 700; font-size: 18px; box-shadow: none !important; }
#scr-att .tbl td:nth-child(3) { width: 132px; }
.srnp { position: relative; flex: 1; min-width: 0; }
.srnp-in { width: 100%; min-height: 36px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 16px; }
.srnp-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; border: 1px solid var(--primary); background: var(--soft); color: var(--primary); font-weight: 700; border-radius: 999px; padding: 6px 10px; min-height: 34px; font-size: 15px; white-space: nowrap; }
.srnp-chip span { opacity: .6; font-weight: 400; }
.srnp-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.14); max-height: 260px; overflow-y: auto; }
.srnp-item { padding: 9px 12px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 16px; display: flex; gap: 8px; align-items: center; }
.srnp-item:last-child { border-bottom: 0; } .srnp-item:active { background: var(--soft); }
.srnp-item small { flex: 1; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srnp-item b { color: var(--ok); font-size: 15px; } .srnp-item i { color: var(--muted); font-size: 13px; font-style: normal; }
.srnp-none { padding: 10px 12px; color: var(--muted); font-size: 15px; }
#att-srn .srnp-in { min-height: 42px; font-size: 17px; }
.hline .srnp { flex: 1; } .hline .srnp-in { min-height: 36px; font-size: 15px; }
/* hour list overflow so the dropdown is not clipped */
#hour-list, .hline { overflow: visible; }
.hline .nm { font-size: 15px; }
h2 { color: #4b5563; }
.card, .task, .hline, .hourly-slot, .egrid, .stat, .tbl { box-shadow: 0 1px 2px rgba(17,24,39,.04), 0 1px 1px rgba(17,24,39,.03); }

/* packing rows: two lines */
.hline.pack { flex-wrap: wrap; gap: 4px 6px; }
.hline.pack .top { width: 100%; display: flex; align-items: center; gap: 6px; }
.hline.pack .top .nm { flex: 1; width: auto; }
.hline.pack .bot { width: 100%; display: flex; align-items: center; gap: 6px; }
.hline.pack .bot .srnp { flex: 1; min-width: 0; }
.hline.pack .bot input { width: 72px; }
.srnp-list { min-width: 250px; max-width: calc(100vw - 32px); }
.hline.pack .srnp-list { left: 0; }

/* PMS */
.pms-grp { margin: 12px 0 4px; font-size: 14px; font-weight: 800; color: #4b5563; display: flex; justify-content: space-between; }
.pms { background: var(--card); border-radius: 10px; padding: 8px 10px; margin-bottom: 5px; box-shadow: 0 1px 2px rgba(17,24,39,.05); }
.pms-h { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.pms-h .srn { font-weight: 800; font-size: 16px; } .pms-h .it { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pms-h .dt { font-size: 13px; color: var(--muted); } .pms-h .pin { border: 1px solid var(--line); background: #fff; color: var(--primary); border-radius: 8px; padding: 2px 8px; font-weight: 700; font-size: 14px; }
.pms-n { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.pms-n div { background: #f7f8fb; border-radius: 8px; padding: 5px 6px; text-align: center; }
.pms-n .k { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.pms-n .v { font-size: 17px; font-weight: 800; }
.pms-n div.bad { background: #fee2e2; } .pms-n div.bad .v { color: #991b1b; }
.pms-n div.bad .k::after { content: ' ⚠'; }
.pms.flag { border-left: 3px solid var(--bad); }
.pms-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.rv-pms { display: flex; gap: 6px; margin-top: 4px; font-size: 13px; }
.rv-pms span { background: #f3f4f6; border-radius: 6px; padding: 2px 6px; } .rv-pms span b { font-size: 14px; } .rv-pms span.bad { background: #fee2e2; color: #991b1b; }
.wa { background: #25d366 !important; }

.wa-prev { white-space: pre-wrap; word-break: break-word; background: #e7f7ec; border-radius: 12px; padding: 12px; font: 13px/1.5 -apple-system, "Segoe UI", Roboto, sans-serif; margin: 0 0 8px; max-height: 45vh; overflow-y: auto; }
a.btn { color: #fff; }

.rep-wrap { background: #e5e7eb; border-radius: 12px; padding: 8px; overflow: auto; }
.rep-wrap canvas { width: 100%; height: auto; display: block; background: #fff; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.rep-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }

.task .v.tri { display: flex; flex-direction: column; align-items: flex-end; font-size: 13px; font-weight: 700; line-height: 1.25; color: var(--muted); }
.task .v.tri b { font-size: 14px; color: var(--text); }
.task .v.tri .st b { color: var(--ok); }
.rep-card { background: var(--card); border-radius: 12px; padding: 10px 12px; margin-bottom: 6px; box-shadow: 0 1px 2px rgba(17,24,39,.05); }
.rep-card .h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.rep-card .h .nm { font-weight: 800; font-size: 16px; } .rep-card .h .srn { font-size: 14px; color: var(--muted); }
.rep-btns { display: flex; gap: 6px; }
.rep-btns button { flex: 1; border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 8px 4px; font-weight: 700; font-size: 14px; color: var(--primary); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.rep-btns button small { font-weight: 500; color: var(--muted); font-size: 12px; }

.hdr-btn { position: relative; }
.hdr-btn .dot { position: absolute; top: 6px; right: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--bad); border: 2px solid var(--primary); }
.dlg-msg { font-size: 17px; margin: 4px 0 12px; line-height: 1.45; white-space: pre-line; }
.ra-item { background: var(--card); border-radius: 12px; padding: 8px; margin-bottom: 8px; box-shadow: 0 1px 2px rgba(17,24,39,.05); }
.ra-item .t { font-weight: 700; font-size: 15px; margin: 0 4px 6px; display: flex; justify-content: space-between; }
.ra-item canvas { width: 100%; height: auto; display: block; border-radius: 6px; border: 1px solid var(--line); }
.tr-role { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.tr-role .n { flex: 1; font-weight: 600; } .tr-role .av { font-size: 14px; color: var(--muted); }
.tr-role input { width: 78px; text-align: center; font-weight: 700; min-height: 38px; padding: 6px; }
.alloc-h { font-weight: 800; margin: 10px 0 4px; display: flex; justify-content: space-between; } .alloc-h span { color: var(--muted); font-weight: 600; font-size: 14px; }
.alloc-h.bad span { color: var(--bad); } .alloc-h.ok span { color: var(--ok); }

.chips button.qc { padding-right: 8px; } .chips button .x { margin-left: 6px; opacity: .6; }
.staff-add { display: flex; gap: 6px; margin: 6px 0 4px; } .staff-add input { flex: 1; } .staff-add .btn { min-height: 40px; padding: 0 14px; }
/* Data tab edit mode */
.dt-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 2px 0 6px; font-size: 14px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.dt-head .lnk { text-transform: none; letter-spacing: 0; }
.ed-list { background: var(--card); border-radius: var(--r); overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.ed-row { display: grid; grid-template-columns: 64px 1fr 76px; gap: 6px; align-items: center; padding: 5px 8px; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; }
.ed-row.end { grid-template-columns: 64px 1fr 56px 56px 56px; }
.ed-row.pack { grid-template-columns: 64px 1fr 74px 62px; }
.ed-row .t { font-weight: 700; font-size: 14px; }
.ed-row select { min-height: 36px; padding: 4px 6px; font-size: 14px; min-width: 0; }
.ed-row input { min-height: 36px; padding: 4px; text-align: center; font-weight: 700; font-size: 16px; width: 100%; }
.ed-row input.e-checker { grid-column: 2 / -1; text-align: left; font-weight: 500; font-size: 15px; min-height: 32px; }
.ed-row.bad { background: var(--bad-soft); border-left-color: var(--bad); }
.ed-row .msg { grid-column: 1 / -1; font-size: 13px; color: var(--bad); font-weight: 600; }
.ed-bar { display: flex; gap: 8px; margin: 10px 0 0; } .ed-bar .btn { flex: 1; margin: 0; }
/* defects */
.dbtn { border: 1px solid var(--line); background: var(--soft); color: var(--primary); border-radius: 8px; padding: 4px 8px; min-height: 30px; font-size: 14px; font-weight: 700; }
.dbtn.need { background: var(--warn-soft); color: var(--warn); border-color: var(--warn); }
.ed-row .dbtn { grid-column: 2 / -1; justify-self: start; }
.hline .chk-name .dbtn { flex: 0 0 auto; }
.def-head { display: flex; justify-content: space-between; align-items: center; margin: 0 0 6px; font-size: 15px; }
.def-list { background: var(--card); border-radius: var(--r); overflow: hidden; max-height: 55vh; overflow-y: auto; }
.def-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; }
.def-row.on { border-left-color: var(--primary); background: var(--soft); }
.def-row .n { font-size: 15px; font-weight: 600; min-width: 0; } .def-row .n small { display: block; font-weight: 500; font-size: 13px; color: var(--muted); } .def-row .n small.tag { display: inline; color: var(--primary); }
.def-row .step { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; } .def-row .step button { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 21px; font-weight: 700; } .def-row .step b { min-width: 22px; text-align: center; }
.ra-btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 6px; margin: 0 0 6px; }
.ra-btns .btn { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; font-size: 14px; }

.def-row .step input.def-n { width: 54px; min-height: 36px; font-size: 16px; }
/* ---- v3 recorder flow: Aaj, wizard, grid, attendance list ---- */
.nowcard .hero-btn { background: #fff; color: var(--primary); font-weight: 800; font-size: 18px; min-height: 52px; }
.aj-list .task.aj { min-height: 56px; padding: 10px 12px; border: 1px solid var(--line); }
.aj-list .task.aj .ic { width: 40px; height: 40px; border-radius: 12px; font-weight: 800; font-size: 18px; }
.aj-list .task.aj .ic.done { background: var(--ok-soft); color: var(--ok); } .aj-list .task.aj .ic.now { background: var(--primary); color: #fff; } .aj-list .task.aj .ic.warn { background: var(--warn-soft); color: var(--warn); } .aj-list .task.aj .ic.todo { background: var(--soft); color: var(--muted); }
.aj-list .task.aj.now { border-color: var(--primary); box-shadow: 0 0 0 3px var(--soft); } .aj-list .task.aj.dim { opacity: .55; }
.aj-list .task.aj .n { font-size: 17px; } .aj-list .task.aj .s { font-size: 13px; white-space: normal; }
.wz-head { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; } .wz-head .hour-title { flex: 1; text-align: center; }
.dots { display: flex; gap: 4px; margin: 0 0 10px; } .dots i { flex: 1; height: 6px; border-radius: 3px; background: var(--line); } .dots i.on { background: var(--ok); } .dots i.now { background: var(--primary); } .dots i.bad { background: var(--bad); }
.linebig { background: var(--card); border: 1.5px solid var(--line); border-radius: 18px; padding: 14px 14px 12px; text-align: center; margin: 0 0 10px; }
.linebig.bad { border-color: var(--bad); }
.linebig .name { font-weight: 800; font-size: 26px; line-height: 1.15; } .linebig .name small { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.linebig .srnchip { display: inline-block; margin-top: 8px; background: var(--soft); color: var(--primary); border: 0; font-weight: 800; padding: 8px 14px; border-radius: 999px; font-size: 16px; } .linebig .srnchip small { font-weight: 500; opacity: .85; font-size: 13px; }
.linebig .qcname { margin-top: 6px; font-size: 13px; color: var(--muted); display: flex; justify-content: center; align-items: center; gap: 4px; } .linebig .qcname svg { width: 14px; height: 14px; }
.linebig .mpline { font-size: 12px; color: var(--muted); margin-top: 4px; }
.linebig .num { font-weight: 800; font-size: 58px; line-height: 1; margin: 12px 0 2px; min-height: 60px; } .linebig .num.empty { color: var(--line); }
.linebig .hint { margin: 0; }
.linebig .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 8px; }
.linebig .fld { background: var(--bg); border: 2px solid var(--line); border-radius: 14px; padding: 8px 10px; text-align: center; }
.linebig .fld .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; } .linebig .fld .v { font-weight: 800; font-size: 36px; line-height: 1.1; } .linebig .fld .v .ph { color: var(--line); }
.linebig .fld.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--soft); background: var(--card); }
.linebig .fld.auto { background: var(--ok-soft); border-color: transparent; margin: 0 0 8px; } .linebig .fld.auto .v { color: var(--ok); font-size: 28px; }
.linebig .dbtn.big { width: 100%; min-height: 44px; font-size: 15px; margin: 4px 0 0; }
.wz-err { margin-top: 10px; background: var(--bad-soft); color: var(--bad); border-radius: 12px; padding: 10px 12px; font-weight: 600; font-size: 14px; } .wz-err .lnk { display: block; margin: 4px auto 0; font-size: 15px; }
.quick { display: flex; gap: 8px; margin: 0 0 10px; } .quick button { flex: 1; border: 1.5px solid var(--line); background: var(--card); color: var(--text); border-radius: 12px; padding: 12px 6px; font-weight: 700; font-size: 14px; min-height: 46px; }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pad button { border: 1px solid var(--line); background: var(--card); border-radius: 14px; font-weight: 800; font-size: 28px; min-height: 58px; color: var(--text); }
.pad button.act { background: var(--soft); color: var(--primary); font-size: 18px; } .pad button.act.go { background: var(--primary); color: #fff; }
.wz-links { display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: center; margin: 12px 0 20px; } .wz-links .lnk { font-size: 13px; }
.gridwrap { overflow-x: auto; background: var(--card); border-radius: var(--r); padding: 6px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.hgrid { border-collapse: separate; border-spacing: 4px; font-size: 13px; }
.hgrid th { font-weight: 700; color: var(--muted); font-size: 12px; text-align: center; padding: 2px 0; }
.hgrid td { min-width: 40px; height: 40px; text-align: center; font-weight: 800; border-radius: 9px; background: var(--bg); border: 1px solid var(--line); }
.hgrid td.ln { text-align: left; padding: 0 8px; white-space: nowrap; font-size: 13px; background: transparent; border-color: transparent; }
.hgrid td.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; } .hgrid td.half { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.hgrid td.now { background: var(--primary); color: #fff; border-color: transparent; } .hgrid td.miss { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.hgrid td.na { background: transparent; border-color: transparent; color: var(--line); } .hgrid td.fut { color: transparent; }
.chk-line { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin: 0 0 8px; }
.chk-line.done { border-color: var(--ok); } .chk-line .b { flex: 1; min-width: 0; } .chk-line .n { font-weight: 800; font-size: 17px; } .chk-line .m { font-size: 13px; color: var(--muted); }
.chk-line .btn.small { margin: 0; min-height: 44px; } .chk-line .btn.same { background: var(--ok); color: #fff; }
#attlist-body { padding-bottom: 80px; }
.lg { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 3px; } .lg.ok { background: var(--ok-soft); border: 1px solid var(--ok); } .lg.half { background: var(--warn-soft); border: 1px solid var(--warn); } .lg.now { background: var(--primary); } .lg.miss { background: var(--bad-soft); border: 1px solid var(--bad); }
/* ---- Target tab ---- */
.tg-in .row { align-items: flex-end; }
.tg-in #tg-line { font-weight: 700; font-size: 17px; text-transform: uppercase; }
.tg-srn { width: 100%; min-height: 44px; border: 1.5px solid var(--line); background: var(--soft); color: var(--primary); border-radius: 10px; font-weight: 800; font-size: 16px; }
.tg-chips { margin-top: 8px; flex-wrap: wrap; }
.tg-k { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin: 0 0 6px; }
.tg-basis button { font-size: 13px; } .tg-basis button b { display: block; font-size: 20px; }
.tg-samrow { display: flex; gap: 6px; } .tg-samrow input { flex: 1; font-weight: 800; font-size: 20px; text-align: center; } .tg-samrow .btn { margin: 0; }
.tg-sam #tg-eff { font-weight: 800; font-size: 20px; text-align: center; }
.tg-hero { background: linear-gradient(135deg, #15803d, #16a34a); color: #fff; border-radius: 18px; padding: 16px; margin: 0 0 8px; }
.tg-hero .k { font-size: 12.5px; opacity: .9; } .tg-hero .v { font-weight: 800; font-size: 54px; line-height: 1.05; margin: 4px 0; } .tg-hero .v small { font-size: 16px; font-weight: 600; opacity: .9; }
.tg-hero .m { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 14px; } .tg-hero .m b { font-size: 17px; }
.tbl-wrap { overflow-x: auto; }
.tg-tbl tr.cur td { background: var(--soft); font-weight: 700; } .tg-tbl tr.closed td { color: var(--muted); }
.tg-tbl td small { color: var(--primary); font-weight: 700; }
.tg-pct { display: inline-block; min-width: 44px; padding: 2px 6px; border-radius: 999px; font-weight: 800; font-size: 13px; text-align: center; }
.tg-pct.ok { background: var(--ok-soft); color: var(--ok); } .tg-pct.mid { background: var(--warn-soft); color: var(--warn); } .tg-pct.low { background: var(--bad-soft); color: var(--bad); }
/* ---- phone app: Attendance · Output ---- */
#matt-body, #mout-body { padding-bottom: 90px; }
.mo-line { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin: 0 0 8px; }
.mo-line.done { border-color: var(--ok); } .mo-line.lock { opacity: .7; } .mo-line.dim { opacity: .75; }
.mo-h { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 6px; } .mo-h .nm { font-weight: 800; font-size: 18px; } .mo-h .mp { color: var(--muted); font-size: 13px; }
.mo-row { display: grid; grid-template-columns: 1fr 110px; gap: 8px; align-items: center; margin: 0 0 6px; }
.mo-row.bad .mo-qty { border-color: var(--bad); background: var(--bad-soft); }
.mo-srn { min-height: 52px; border: 1.5px solid var(--line); background: var(--soft); color: var(--primary); border-radius: 12px; font-weight: 800; font-size: 16px; text-align: left; padding: 6px 12px; }
.mo-srn small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); } .mo-srn:disabled { opacity: 1; background: var(--bg); color: var(--text); }
.mo-qty { min-height: 52px; font-size: 24px; font-weight: 800; text-align: center; border-radius: 12px; }
.mo-note { grid-column: 1 / -1; font-size: 12px; color: var(--muted); } .mo-err { grid-column: 1 / -1; font-size: 13px; color: var(--bad); font-weight: 600; }
.mo-add { font-size: 13px; }
.mo-total { display: flex; align-items: baseline; gap: 10px; background: var(--card); border-radius: 14px; padding: 12px 14px; border: 1px solid var(--line); margin: 4px 0 0; }
.mo-total span { flex: 1; font-weight: 700; } .mo-total b { font-size: 24px; } .mo-total small { color: var(--muted); }
/* phone attendance / output v2 */
select.al-srn { width: 100%; margin-top: 6px; min-height: 42px; font-weight: 700; font-size: 15px; color: var(--primary); }
div.al-srn { font-size: 12px; margin-top: 4px; }
.chk-line.al-pend, .chk-line.al-done { flex-wrap: wrap; } .chk-line.al-pend .b, .chk-line.al-done .b { flex: 1 1 100%; }
.chk-line.al-pend .btn.small, .chk-line.al-done .btn.small { flex: 1; }
.al-ev { color: var(--warn) !important; }
.mo-card { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; margin: 0 0 8px; color: var(--text); }
.mo-card.done { border-color: var(--ok); } .mo-card.lock { opacity: .8; } .mo-card.dim { opacity: .75; }
.mo-card .b { flex: 1; min-width: 0; display: flex; flex-direction: column; } .mo-card .nm { font-weight: 800; font-size: 18px; } .mo-card .s { font-size: 13px; color: var(--muted); } .mo-card .st { font-size: 12px; font-weight: 700; color: var(--primary); margin-top: 2px; }
.mo-card .v { font-weight: 800; font-size: 24px; text-align: right; } .mo-card .v small { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.mo-info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0 0 8px; } .mo-info div { background: var(--bg); border-radius: 10px; padding: 6px 8px; text-align: center; } .mo-info span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; } .mo-info b { font-size: 20px; } .mo-info small { display: block; font-size: 11px; color: var(--muted); }
#mo-srn { width: 100%; min-height: 46px; font-weight: 800; font-size: 16px; }
.mo-load { font-size: 13px; color: var(--muted); margin: 6px 0 2px; }
.mo-big { width: 100%; min-height: 60px; font-size: 32px !important; font-weight: 800; text-align: center; }
.mo-chk .warn { background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 8px 10px; font-weight: 600; font-size: 14px; margin: 8px 0 0; }
.mo-chk .okk { color: var(--ok); font-weight: 700; font-size: 14px; margin: 8px 0 0; }
.mo-past { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--warn-soft); color: var(--warn); border-radius: 12px; padding: 8px 12px; margin: 0 0 8px; font-size: 14px; } .mo-past .btn { margin: 0; }
.mo-pend { background: var(--card); border: 1.5px solid var(--warn); border-radius: 14px; padding: 8px 10px; margin: 0 0 10px; }
.mo-pend .t { font-weight: 800; color: var(--warn); font-size: 14px; margin: 0 0 4px; }
.mo-pend button { display: flex; align-items: center; gap: 8px; width: 100%; background: var(--bg); border: 0; border-radius: 10px; padding: 10px 12px; margin: 4px 0 0; color: var(--text); text-align: left; }
.mo-pend button span { font-weight: 800; } .mo-pend button small { flex: 1; color: var(--muted); } .mo-pend button b { color: var(--primary); }
.mo-card em.ot { font-style: normal; font-size: 12px; background: var(--soft); color: var(--primary); border-radius: 6px; padding: 1px 6px; vertical-align: 2px; }
.al-tg { margin-top: 4px; font-size: 14px; color: var(--ok); } .al-tg b { font-size: 16px; } .al-tg small { color: var(--muted); font-size: 12px; }
.att-tg { background: var(--ok-soft); border-radius: 12px; padding: 10px 12px; margin: 8px 0 0; text-align: center; font-size: 15px; } .att-tg b { font-size: 20px; }
/* phone: attendance form header row wraps so the line name is readable (computer layout unchanged) */
@media (max-width: 820px) {
  #scr-att .card > .row:first-child { flex-wrap: wrap; }
  #scr-att .card > .row:first-child .field:first-child { flex: 1 1 100%; }
}
.al-tg .lnk { font-size: 13px; padding: 0 0 0 4px; }
.pa-top .row { align-items: flex-end; } .pa-top #pa-line { font-weight: 700; font-size: 16px; min-height: 44px; } .pa-top #pa-date { min-height: 44px; }
h2.mo-date { display: flex; justify-content: space-between; margin: 12px 0 6px; } h2.mo-date span { color: var(--warn); }
.pa-acts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; width: 100%; margin-top: 8px; }
.pa-acts .btn.small { margin: 0; min-height: 52px; padding: 6px 4px; font-size: 13px; line-height: 1.2; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pa-acts .btn small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
.upd-kind { display: grid; gap: 10px; margin: 0 0 12px; } .upd-kind .btn { margin: 0; display: flex; flex-direction: column; } .upd-kind .btn small { font-size: 12px; font-weight: 500; opacity: .85; }
.upd-kind .btn[data-kind="ABSENT"] { background: var(--bad); } .upd-kind .btn[data-kind="HALF_DAY"] { background: var(--warn); }
.upd-head { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 17px; margin: 0 0 4px; }
#u-role, #u-hours { width: 100%; min-height: 46px; font-weight: 700; font-size: 16px; }
.att-cancel { color: var(--bad) !important; margin-top: 10px; }
.mo-card em.sh-Final { background: var(--ok-soft); color: var(--ok); } .mo-card em.sh-Night { background: #ede9fe; color: #6d28d9; }
.upd-box { border-radius: 12px; padding: 8px 10px 10px; margin: 10px 0 0; } .upd-box .t { font-weight: 800; font-size: 15px; margin: 0 0 2px; }
.upd-box.hd { background: var(--warn-soft); } .upd-box.hd .t { color: var(--warn); } .upd-box.ab { background: var(--bad-soft); } .upd-box.ab .t { color: var(--bad); }
.upd-box input, .upd-box select { width: 100%; min-height: 46px; font-size: 20px; font-weight: 800; text-align: center; } .upd-box select { font-size: 16px; }
.pa-acts .btn.upd { color: var(--warn); }
/* phone PMS tab */
.pm-q { width: 100%; font-size: 17px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text); margin: 0 0 6px; }
.pm-sub { font-size: 13px; color: var(--muted); margin: 0 2px 10px; }
.pm-card { background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; margin: 0 0 8px; }
.pm-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; } .pm-h b { font-size: 18px; } .pm-h span { font-size: 13px; color: var(--muted); }
.pm-s { font-size: 13px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-g { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.pm-c { display: flex; flex-direction: column; background: var(--bg); border-radius: 10px; padding: 6px 8px; } .pm-c small { font-size: 11px; color: var(--muted); } .pm-c b { font-size: 17px; }
.pm-c.warn { outline: 1.5px solid var(--bad); } .pm-c.warn b { color: var(--bad); }
.pm-ct { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--bg); border: 1.5px dashed var(--warn); font-size: 13px; } .pm-ct b { font-size: 17px; }
/* phone transfer manpower */
.pa-acts .btn.trb { color: var(--primary); }
.tr-in { border: 1.5px solid var(--warn); margin: 0 0 10px; }
.tr-in .tr-h { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--warn); }
.tr-in .tr-b { font-size: 17px; margin: 2px 0; } .tr-in .m { font-size: 13px; color: var(--muted); }
.tr-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; } .tr-acts .btn { margin: 0; min-height: 44px; }
.tr-st { font-weight: 600; } .tr-st.wait { color: var(--warn); } .tr-st.ok { color: var(--ok); } .tr-st.bad { color: var(--bad); }
.tr-roles .item input { width: 84px; text-align: center; font-size: 18px; }
.nav-dot { position: absolute; top: 4px; left: calc(50% + 8px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-style: normal; font-weight: 800; line-height: 18px; text-align: center; }
/* phone: attendance saves on their way / failed */
.ob-line { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 4px; }
.ob-line.bad { color: var(--bad); justify-content: space-between; background: var(--bad-soft); border-radius: 10px; padding: 6px 8px; }
.ob-line .btn.small { margin: 0; min-height: 34px; padding: 4px 12px; }
.ob-spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--primary); animation: obspin .8s linear infinite; flex: none; }
@keyframes obspin { to { transform: rotate(360deg); } }
/* phone: output by date + admin approve */
.mo-seg { display: grid; grid-template-columns: 1fr 1fr; margin: 0 0 10px; }
.mo-sum { font-size: 14px; color: var(--muted); margin: 0 2px 6px; }
.mo-card.wait { border-color: var(--warn); }
.rv-card { margin: 0 0 8px; } .rv-card .rv-h { display: flex; align-items: baseline; gap: 6px; font-size: 17px; } .rv-card .rv-q { margin-left: auto; font-size: 20px; font-weight: 800; }
.rv-card .m { font-size: 13px; color: var(--muted); } .rv-flag.block { color: var(--bad); font-weight: 600; } .rv-flag.warn { color: var(--warn); }
.rv-card .rv-h em { white-space: nowrap; }
/* phone: Making Output Report (admin review) */
.rv-acts { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 10px; } .rv-acts .btn { margin: 0; min-height: 44px; }
.mor { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; border: 1px solid var(--line); border-radius: 10px; }
.mor-t { border-collapse: collapse; font-size: 12px; min-width: 1100px; background: var(--card); }
.mor-t th, .mor-t td { border: 1px solid var(--line); padding: 5px 6px; text-align: center; white-space: nowrap; }
.mor-t th { background: var(--bg); font-weight: 700; } .mor-t .mor-h th { white-space: normal; min-width: 54px; } .mor-t .mor-g th { font-size: 13px; }
.mor-t td:nth-child(7) { white-space: normal; min-width: 160px; text-align: left; }
.mor-t tr.mor-cf td { font-weight: 700; background: var(--bg); } .mor-t tr.mor-pend td { background: #fff4d6; font-weight: 700; } .mor-t tr.mor-app td { background: #f3f7ff; }
.mor-t td.bad { color: var(--bad); } .mor-why { width: 100%; min-width: 150px; font-size: 13px; padding: 6px; border: 1px solid var(--warn); border-radius: 6px; }
#mo-why { width: 100%; font-size: 15px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text); margin: 0 0 10px; font-family: inherit; }
.al-srn.need { border: 2px solid var(--bad) !important; background: var(--bad-soft); }
.rv-floor { display: flex; gap: 8px; margin-top: 8px; } .rv-floor select { flex: 1; font-size: 15px; padding: 8px 10px; border: 1.5px solid var(--warn); border-radius: 10px; background: var(--card); } .rv-floor .btn { margin: 0; min-height: 40px; }
.rv-acts.four { grid-template-columns: 1fr 1fr 1fr 1fr; gap: 6px; } .rv-acts.four .btn { padding: 6px 4px; font-size: 13px; }
.e-roles { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 0 0 10px; } .e-roles label { font-size: 11px; } .e-roles input { text-align: center; }
#e-why { width: 100%; font-size: 15px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text); margin: 0 0 10px; font-family: inherit; }

/* =====================================================================================================
   PHONE APP · compact professional design (body.phone is set only in phone mode; the web keeps the rules above)
   ===================================================================================================== */
body.phone {
  --bg: #f1f4f8; --card: #fff; --text: #0f172a; --muted: #64748b; --line: #e2e8f0; --soft: #eef3ff;
  --primary: #1d4ed8; --primary-dark: #1e3a8a; --ok: #15803d; --ok-soft: #e7f6ec; --warn: #b45309; --warn-soft: #fdf3e1;
  --bad: #c81e1e; --bad-soft: #fdecec; --r: 10px; --nav-h: 52px;
  font-size: 14px; line-height: 1.35; letter-spacing: -.005em; background: var(--bg);
}
body.phone main { padding: 8px 10px calc(var(--nav-h) + 64px); }
body.phone h2 { font-size: 11px; letter-spacing: .07em; color: var(--muted); margin: 12px 2px 5px; }
body.phone label { font-size: 11.5px; font-weight: 600; color: var(--muted); margin: 6px 0 3px; letter-spacing: .01em; }
body.phone .hint { font-size: 12.5px; margin: 5px 0 0; }
body.phone .empty { font-size: 13.5px; padding: 18px 6px; }
body.phone svg { width: 20px; height: 20px; }

/* header: slim navy bar */
body.phone .hdr { min-height: 46px; padding: 3px 6px; padding-top: max(3px, env(safe-area-inset-top)); background: var(--primary-dark); }
body.phone .hdr-title { font-size: 15.5px; font-weight: 650; letter-spacing: -.01em; }
body.phone .hdr-sub { font-size: 11.5px; opacity: .78; }
body.phone .hdr-btn { width: 36px; height: 36px; }
body.phone .hdr-btn svg { width: 19px; height: 19px; }

/* bottom nav */
body.phone .nav { box-shadow: 0 -1px 0 var(--line); border-top: 0; }
body.phone .nav button { min-height: var(--nav-h); font-size: 10.5px; font-weight: 600; padding: 6px 0 3px; gap: 2px; letter-spacing: .01em; }
body.phone .nav button svg { width: 21px; height: 21px; }
body.phone .nav button.on { color: var(--primary); }
body.phone .nav button.on::before { content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 2.5px; border-radius: 0 0 3px 3px; background: var(--primary); }
body.phone .nav-dot { top: 3px; min-width: 16px; height: 16px; line-height: 16px; font-size: 10px; padding: 0 4px; }

/* inputs + buttons (inputs keep 16px text: smaller makes phones zoom in) */
body.phone input[type=text], body.phone input[type=password], body.phone input[type=date], body.phone input[type=number],
body.phone input[type=time], body.phone input[type=tel], body.phone input[type=search], body.phone select, body.phone textarea {
  min-height: 38px; padding: 6px 10px; border-radius: 8px; border: 1px solid #d5dbe5; font-size: 16px; background-color: #fff;
}
body.phone select { padding-right: 26px !important; background-position: right 6px center; }
body.phone .btn { min-height: 36px; padding: 7px 12px; border-radius: 8px; font-weight: 650; font-size: 14px; letter-spacing: .005em; }
body.phone .btn.big { min-height: 42px; font-size: 15px; margin-top: 8px; border-radius: 9px; }
body.phone .btn.small { min-height: 32px; padding: 5px 10px; font-size: 13px; border-radius: 7px; }
body.phone .btn.ghost { background: var(--soft); color: var(--primary); }
body.phone .lnk { font-size: 13px; }
body.phone .card { border-radius: var(--r); padding: 9px 11px; margin-bottom: 8px; box-shadow: none; border: 1px solid var(--line); }
body.phone .seg { margin: 0 0 8px; padding: 3px; border-radius: 9px; background: #e6ebf2; }
body.phone .seg button { padding: 6px 8px; font-size: 13px; border-radius: 7px; font-weight: 650; }
body.phone .banner { font-size: 13px; padding: 7px 10px; border-radius: 8px; margin-top: 8px; }
body.phone .toast { font-size: 14px; padding: 9px 14px; border-radius: 9px; }
body.phone em.ot, body.phone .mo-card em.ot { font-size: 10.5px; font-weight: 700; border-radius: 4px; padding: 1px 5px; letter-spacing: .02em; vertical-align: 1px; }
body.phone em.tag { font-style: normal; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 4px; background: #eef1f5; color: var(--muted); white-space: nowrap; letter-spacing: .02em; }
body.phone em.tag.ok { background: var(--ok-soft); color: var(--ok); } body.phone em.tag.warn { background: var(--warn-soft); color: var(--warn); }

/* sticky action (WhatsApp / Save) */
body.phone .sticky-bottom { padding: 6px 10px; padding-bottom: max(6px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 35%); }
body.phone .sticky-bottom .btn.big { min-height: 40px; font-size: 14px; margin: 0 auto; }
body.phone .sticky-bottom .btn.big svg { width: 18px; height: 18px; }

/* bottom sheets */
body.phone .sheet-body { border-radius: 14px 14px 0 0; padding: 8px 12px max(12px, env(safe-area-inset-bottom)); }
body.phone .sheet-head { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
body.phone .sheet-head .hdr-btn.dark { width: 34px; height: 34px; border-radius: 8px; }

/* ---------- Attendance tab ---------- */
body.phone .pa-top { padding: 8px 10px; }
body.phone .pa-top .row { gap: 8px; }
body.phone .pa-top label { margin-top: 0; }
body.phone .pa-top #pa-line, body.phone .pa-top #pa-date { min-height: 38px; font-size: 15px; }
body.phone .pa-top #pa-line { font-weight: 650; }
body.phone h2.pl-sec { display: flex; justify-content: space-between; margin: 10px 2px 5px; } body.phone h2.pl-sec span { color: var(--muted); font-weight: 600; letter-spacing: .03em; }
body.phone .chk-line.pl-card { display: block; padding: 8px 10px; margin: 0 0 6px; border-radius: var(--r); border: 1px solid var(--line); border-left: 3px solid var(--ok); background: var(--card); }
body.phone .pl-h { display: flex; align-items: center; gap: 5px; min-width: 0; }
body.phone .pl-h .n { font-size: 15px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
body.phone .pl-mp { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; } body.phone .pl-mp b { font-size: 15px; color: var(--text); }
body.phone .pl-card .m { font-size: 12px; color: var(--muted); margin-top: 1px; line-height: 1.35; } body.phone .pl-card .m b { color: var(--text); font-weight: 650; }
body.phone .pl-card .al-tg { font-size: 12px; margin-top: 2px; } body.phone .pl-card .al-tg b { font-size: 13px; }
body.phone .pl-card .ob-line { font-size: 12px; margin-top: 3px; }
body.phone .pa-acts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 7px; }
body.phone .pa-acts .btn.small { min-height: 30px; padding: 3px 2px; font-size: 11.5px; font-weight: 650; border-radius: 6px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
body.phone .pa-acts .btn small { display: none; }
body.phone .tr-in { padding: 8px 10px; border: 1px solid var(--warn); border-left-width: 3px; background: #fffaf2; }
body.phone .tr-in .tr-h { display: block; font-size: 10.5px; letter-spacing: .06em; margin-bottom: 1px; }
body.phone .tr-in .tr-b { font-size: 14px; margin: 0; } body.phone .tr-in .m { font-size: 12px; }
body.phone .tr-acts { margin-top: 7px; gap: 6px; } body.phone .tr-acts .btn { min-height: 32px; }

/* attendance form (Fill / Change / OT) */
body.phone #scr-att .card { padding: 8px 10px; }
body.phone #scr-att .tbl { border: 1px solid var(--line); box-shadow: none; }
body.phone #scr-att .tbl th { font-size: 10.5px; padding: 5px 8px; }
body.phone #scr-att .tbl td { padding: 4px 8px; font-size: 13.5px; }
body.phone #scr-att .tbl td select, body.phone #scr-att .tbl td input { min-height: 34px; padding: 4px; font-size: 15px; }
body.phone #scr-att .tbl td:nth-child(2) { width: 68px; } body.phone #scr-att .tbl td:nth-child(3) { width: 116px; }
body.phone .step { border-radius: 8px; border-color: #d5dbe5; }
body.phone .step button { width: 32px; min-height: 34px; font-size: 19px; }
body.phone .step input { width: 50px; min-height: 34px; font-size: 16px; }
body.phone #att-srn .srnp-in { min-height: 38px; font-size: 15px; }
body.phone .srnp-chip { min-height: 30px; padding: 4px 10px; font-size: 13.5px; }
body.phone .srnp-item { padding: 8px 10px; font-size: 14px; }
body.phone .att-tg { font-size: 13px; padding: 7px 10px; border-radius: 8px; } body.phone .att-tg b { font-size: 16px; }
body.phone .al-srn.need { border-width: 1.5px !important; }

/* ---------- Output tab ---------- */
body.phone h2.mo-date { margin: 10px 2px 5px; }
body.phone .mo-card { padding: 8px 10px; margin: 0 0 6px; border-radius: var(--r); border: 1px solid var(--line); border-left: 3px solid #cbd5e1; gap: 8px; }
body.phone .mo-card.done { border-color: var(--line); border-left-color: var(--ok); }
body.phone .mo-card.wait { border-color: var(--line); border-left-color: var(--warn); }
body.phone .mo-card .nm { font-size: 14.5px; font-weight: 750; }
body.phone .mo-card .s { font-size: 12px; }
body.phone .mo-card .st { font-size: 11.5px; margin-top: 1px; }
body.phone .mo-card .v { font-size: 18px; font-weight: 750; } body.phone .mo-card .v small { font-size: 10.5px; }
body.phone .mo-sum { font-size: 12.5px; }
body.phone .mo-info { gap: 5px; margin: 0 0 6px; } body.phone .mo-info div { padding: 5px 6px; border-radius: 8px; border: 1px solid var(--line); background: #f8fafc; }
body.phone .mo-info span { font-size: 10px; letter-spacing: .05em; } body.phone .mo-info b { font-size: 16px; }
body.phone #mo-srn { min-height: 40px; font-size: 15px; }
body.phone .mo-load { font-size: 12px; margin: 4px 0 0; }
body.phone .mo-big { min-height: 48px; font-size: 26px !important; border-radius: 9px !important; }
body.phone #mo-why, body.phone #e-why { font-size: 15px; padding: 8px 10px; border-radius: 8px; margin: 0 0 6px; }
body.phone .mo-chk .warn { font-size: 12.5px; padding: 6px 9px; border-radius: 8px; margin: 6px 0 0; } body.phone .mo-chk .okk { font-size: 12.5px; margin: 6px 0 0; }

/* ---------- PMS tab ---------- */
body.phone .pm-q { min-height: 38px; font-size: 15px; padding: 7px 12px; border: 1px solid #d5dbe5; border-radius: 9px; margin: 0 0 4px; }
body.phone .pm-sub { font-size: 11.5px; margin: 0 2px 6px; }
body.phone .pm-card { padding: 8px 10px; margin: 0 0 6px; border: 1px solid var(--line); border-radius: var(--r); }
body.phone .pm-h { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
body.phone .pm-h > b { font-size: 14.5px; font-weight: 750; flex: none; }
body.phone .pm-h .pm-s { flex: 1; min-width: 0; font-size: 11.5px; margin: 0; }
body.phone .pm-o { font-size: 11.5px; color: var(--muted); white-space: nowrap; } body.phone .pm-o b { color: var(--text); font-size: 12.5px; }
body.phone .pm-g { grid-template-columns: repeat(6, 1fr); gap: 0; margin-top: 6px; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
body.phone .pm-c { background: #f8fafc; border-radius: 0; padding: 3px 2px 4px; text-align: center; border-left: 1px solid var(--line); min-width: 0; }
body.phone .pm-c:first-child { border-left: 0; }
body.phone .pm-c small { font-size: 9.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; }
body.phone .pm-c b { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.phone .pm-c.warn { outline: 0; background: var(--bad-soft); } body.phone .pm-c.warn b { color: var(--bad); }
body.phone .pm-bar { position: relative; height: 4px; border-radius: 2px; background: #e8edf3; margin-top: 6px; overflow: hidden; }
body.phone .pm-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: #93b4f5; border-radius: 2px; }
body.phone .pm-bar i.pk { background: var(--primary); } body.phone .pm-bar i.sh { background: var(--ok); }
body.phone .pm-ct { margin-top: 6px; padding: 5px 8px; font-size: 11.5px; border-radius: 7px; border-width: 1px; }
body.phone .pm-ct i { color: var(--muted); font-style: normal; } body.phone .pm-ct b { font-size: 13.5px; }

/* ---------- Approve tab ---------- */
body.phone .rv-card { padding: 8px 10px; margin: 0 0 6px; border-left: 3px solid var(--warn); }
body.phone .rv-card .rv-h { font-size: 14.5px; gap: 5px; align-items: center; min-width: 0; }
body.phone .rv-card .rv-h b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
body.phone .rv-card .rv-q { font-size: 17px; font-weight: 750; white-space: nowrap; } body.phone .rv-card .rv-q small { font-size: 11px; color: var(--muted); font-weight: 600; }
body.phone .rv-card .m { font-size: 12px; }
body.phone .rv-acts { gap: 5px; margin-top: 7px; } body.phone .rv-acts .btn, body.phone .rv-acts.four .btn { min-height: 32px; font-size: 12.5px; padding: 4px; }
body.phone .rv-floor { gap: 6px; margin-top: 6px; } body.phone .rv-floor select { min-height: 34px; font-size: 14px; padding: 4px 8px; border-width: 1px; } body.phone .rv-floor .btn { min-height: 34px; }
body.phone .e-roles { gap: 6px; margin: 0 0 8px; }

/* ---------- Main tab ---------- */
body.phone .me .av { width: 40px; height: 40px; font-size: 17px; }
body.phone .me .n { font-size: 16px; } body.phone .me .s { font-size: 12.5px; }
body.phone .menu .task, body.phone .task { min-height: 46px; padding: 7px 10px; border: 1px solid var(--line); box-shadow: none; border-radius: var(--r); margin-bottom: 5px; }
body.phone .task .n { font-size: 14.5px; } body.phone .task .s { font-size: 12px; }
body.phone .task .ic { width: 28px; height: 28px; border-radius: 7px; }

/* motion: quieter on the phone */
body.phone .screen.in { animation-duration: .12s; }
body.phone .tl .task, body.phone .rv-item, body.phone .list .item { animation: none; }
body.phone .pl-card .m.tr-st.wait { color: var(--warn); font-weight: 600; } body.phone .pl-card .m.tr-st.ok { color: var(--ok); font-weight: 600; } body.phone .pl-card .m.tr-st.bad { color: var(--bad); font-weight: 600; }
body.phone .pl-card .m.al-ev { color: var(--warn); font-weight: 600; }
body.phone .pl-card .m:empty { display: none; }
body.phone #scr-att .card > .row:first-child { gap: 8px; }
body.phone #scr-att .card > .row:first-child .field.small { flex: 1 1 0; }
body.phone #att-floor { min-height: 38px; font-size: 15px; }
body.phone .mo-card:not(.wait):not(.done):not(.lock) { border-left-color: var(--primary); }
body.phone .mo-card .v small { font-weight: 700; }
/* attendance line card v2: line + SRN, manpower · hourly target · recorder, pencil -> actions popup */
body.phone .pl-card .pl-h { gap: 6px; }
body.phone .pl-srn { font-size: 12px; font-weight: 700; color: var(--primary); background: var(--soft); border-radius: 5px; padding: 2px 7px; white-space: nowrap; }
body.phone .pl-edit { margin-left: auto; flex: none; width: 32px; height: 30px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--primary); display: flex; align-items: center; justify-content: center; padding: 0; }
body.phone .pl-edit svg { width: 16px; height: 16px; } body.phone .pl-edit:active { background: var(--soft); }
body.phone .pl-h .tag { margin-left: auto; }
body.phone .pl-kv { display: grid; grid-template-columns: 0.8fr 1fr 1.2fr; margin-top: 6px; border-top: 1px solid #eef1f5; padding-top: 5px; }
body.phone .pl-kv > div { min-width: 0; padding-right: 6px; }
body.phone .pl-kv > div + div { border-left: 1px solid #eef1f5; padding-left: 8px; }
body.phone .pl-kv small { display: block; font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
body.phone .pl-kv b { display: block; font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.phone .pl-kv b i { font-style: normal; font-size: 11px; font-weight: 600; color: var(--muted); }
body.phone .pl-kv b.na { color: #cbd5e1; } body.phone .pl-kv b.who { font-size: 13px; font-weight: 600; padding-top: 1px; }
/* actions popup */
.pl-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 2px 0 6px; }
.pl-acts .btn { margin: 0; min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 14px; line-height: 1.2; }
.pl-acts .btn small { font-size: 11px; font-weight: 500; color: var(--muted); }
.pl-acts .btn.upd { color: var(--warn); } .pl-acts .btn.wide { grid-column: 1 / -1; min-height: 44px; }
.pl-info { border-top: 1px solid var(--line); padding-top: 6px; margin-top: 4px; }
.pl-info .m { font-size: 12.5px; color: var(--muted); margin: 2px 0; } .pl-info .m.tr-st.wait { color: var(--warn); font-weight: 600; } .pl-info .m.tr-st.bad { color: var(--bad); font-weight: 600; } .pl-info .m.tr-st.ok { color: var(--ok); font-weight: 600; }
body.phone .pl-staff { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; font-size: 11px; line-height: 1.25; color: var(--text); font-weight: 600; }
body.phone .pl-staff span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.phone .pl-staff i { font-style: normal; font-weight: 600; font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-right: 2px; }
body.phone .pl-h .n, body.phone .pl-srn { flex: none; }
body.phone .pl-h .n { max-width: 46%; }
/* "turn on notifications" card (phone Attendance tab) */
body.phone .nt-ask { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-color: #c7d6fb; background: #f4f7ff; }
body.phone .nt-ask .b { flex: 1; min-width: 0; display: flex; flex-direction: column; } body.phone .nt-ask b { font-size: 13.5px; } body.phone .nt-ask span { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
body.phone .nt-btns { display: flex; gap: 5px; flex: none; } body.phone .nt-btns .btn.small { min-height: 30px; padding: 4px 9px; font-size: 12px; }
.ob-btns { display: flex; gap: 5px; flex: none; }
/* Main -> Notifications sheet */
.nt-state { background: var(--bg); border-radius: 10px; padding: 9px 11px; margin: 0 0 8px; display: flex; flex-direction: column; gap: 2px; } .nt-state span { font-size: 12.5px; color: var(--muted); }
.nt-list { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.nt-list > div { display: flex; justify-content: space-between; gap: 8px; padding: 6px 9px; border-top: 1px solid var(--line); font-size: 12.5px; } .nt-list > div:first-child { border-top: 0; }
.nt-list span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .nt-list b { flex: none; color: var(--muted); font-weight: 600; }
.nt-list > div.on b { color: var(--ok); } .nt-list > div.bad b { color: var(--bad); } .nt-list.log span { white-space: normal; }
/* accept a transfer: split over lines */
.ac-role { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin: 0 0 8px; }
.ac-h { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 6px; } .ac-h span { font-size: 12.5px; font-weight: 700; } .ac-h span.ok { color: var(--ok); } .ac-h span.bad { color: var(--bad); }
.ac-row { display: grid; grid-template-columns: 1fr 70px 30px; gap: 6px; align-items: center; margin: 0 0 6px; }
.ac-row select, .ac-row input { min-height: 38px; } .ac-row input { text-align: center; font-weight: 700; }
.ac-x { border: 0; background: none; color: var(--muted); font-size: 16px; padding: 0; height: 30px; }
.ac-h span.warn { color: var(--warn); }
.btn.ok.warn { background: var(--warn); }
/* phone Report tab */
body.phone .rp-top .row { align-items: flex-end; gap: 8px; } body.phone .rp-top label { margin-top: 0; }
.rp-head { display: flex; align-items: baseline; gap: 8px; margin: 2px 2px 6px; } .rp-head b { font-size: 16px; } .rp-head span { font-size: 12px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-lines { margin: 0 0 6px; } .rp-lines button small { display: block; font-size: 10.5px; font-weight: 500; }
.rp-sum { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; margin: 0 0 8px; }
.rp-sum div { background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 6px 8px; text-align: center; }
.rp-sum small { display: block; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; } .rp-sum b { font-size: 17px; } .rp-sum b.bad { color: var(--bad); }
.pm-card[data-rep] { cursor: pointer; } .pm-card[data-rep]:active { background: var(--soft); }
/* report image preview */
.si-prev { background: #e5e7eb; border-radius: 10px; padding: 6px; margin: 0 0 8px; max-height: 55vh; overflow: auto; }
.si-prev img { display: block; width: 100%; height: auto; border-radius: 4px; box-shadow: 0 1px 4px rgba(0,0,0,.15); background: #fff; }
/* Report tab: SRN picker that opens while typing */
.rp-pick { position: relative; }
.rp-dd { position: absolute; left: 0; right: -64px; top: calc(100% + 4px); z-index: 30; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.14); max-height: 300px; overflow-y: auto; }
.rp-dd button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; border: 0; border-bottom: 1px solid var(--line); background: #fff; padding: 8px 12px; text-align: left; color: var(--text); }
.rp-dd button:last-child { border-bottom: 0; } .rp-dd button:active { background: var(--soft); }
.rp-dd b { font-size: 14.5px; } .rp-dd small { font-size: 11.5px; color: var(--muted); }
.rp-none { padding: 10px 12px; font-size: 13px; color: var(--muted); }
.pm-card.shipped { opacity: .85; border-style: dashed; }
/* PMS: simple table, one row per SRN */
.pm-tw { background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.pm-t { width: 100%; border-collapse: collapse; table-layout: fixed; font-variant-numeric: tabular-nums; }
.pm-t thead th { position: sticky; top: 0; z-index: 2; background: #f3f5f9; font-size: 9.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; padding: 7px 3px 7px 0; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.pm-t th.s, .pm-t td.s { text-align: left; width: 25%; padding-left: 8px; }
.pm-t td { padding: 8px 3px 8px 0; font-size: 12px; font-weight: 600; letter-spacing: -.2px; text-align: right; border-top: 1px solid #eef1f5; vertical-align: top; white-space: nowrap; overflow: visible; }
.pm-t tbody tr:first-child td { border-top: 0; }
.pm-t td.z { color: #c3cad5; font-weight: 500; } .pm-t td.bad { color: var(--bad); background: #fff3f3; }
.pm-t td.s { overflow: hidden; letter-spacing: 0; } .pm-t td.s b { font-size: 13.5px; display: block; }
.pm-t td.s i { font-style: normal; font-size: 9px; font-weight: 700; color: var(--ok); background: var(--ok-soft); border-radius: 4px; padding: 1px 4px; display: inline-block; margin-top: 2px; }
.pm-t td.s small { display: block; font-size: 10.5px; font-weight: 500; color: var(--muted); overflow: hidden; text-overflow: ellipsis; } .pm-t td.s small.oq { color: var(--text); font-weight: 600; } .pm-t td.s small.ct { color: var(--warn); }
.pm-t td:nth-child(odd):not(.s), .pm-t th:nth-child(odd):not(.s) { background-color: #f7f9fc; } .pm-t td.bad { background: #fff3f3; }
.pm-t tr[data-rep] { cursor: pointer; } .pm-t tr[data-rep]:active td { background: var(--soft); } .pm-t tr.shipped td { color: var(--muted); }
.pm-note { font-size: 11px; color: var(--muted); margin: 6px 2px 0; line-height: 1.4; }
.pm-tw { overflow: clip; } body.phone .pm-t thead th { top: 46px; }
.pm-t thead th { font-size: 9.5px; letter-spacing: 0; padding: 7px 3px 7px 0; }
/* PDR (day report) on the phone */
.pdr-m { background: var(--card); border: 1px solid var(--line); border-radius: 10px; margin: 0 0 10px; overflow: hidden; }
.pdr-h { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #eef3ff; }
.pdr-h > div { flex: 1; min-width: 0; } .pdr-h small { display: block; font-size: 9.5px; font-weight: 800; color: var(--primary); letter-spacing: .06em; text-transform: uppercase; }
.pdr-h b { font-size: 15px; color: #1e3a8a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; } .pdr-h .btn.small { margin: 0; min-height: 28px; padding: 3px 10px; }
.ach { font-weight: 800; } span.ach { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #f1f5f9; color: var(--muted); }
.ach.ok { color: #15803d; } .ach.mid { color: #b45309; } .ach.low { color: #c81e1e; }
span.ach.ok { background: #dcfce7; } span.ach.mid { background: #fef3c7; } span.ach.low { background: #fee2e2; }
.pdr-t { width: 100%; border-collapse: collapse; table-layout: fixed; font-variant-numeric: tabular-nums; }
.pdr-t th { font-size: 9.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; padding: 6px 4px; text-align: right; border-bottom: 1px solid var(--line); }
.pdr-t td { font-size: 12.5px; padding: 6px 4px; text-align: right; border-top: 1px solid #eef1f5; vertical-align: top; }
.pdr-t .l { text-align: left; width: 38%; padding-left: 10px; } .pdr-t td.l b { font-size: 13px; display: block; } .pdr-t td.l small { display: block; font-size: 10.5px; color: var(--muted); line-height: 1.3; } .pdr-t td.l i { color: var(--warn); font-style: normal; font-weight: 600; }
.pdr-t td.neg { color: var(--bad); }
.pdr-t .end { background: #f0fdf4; color: #15803d; } .pdr-t th:last-child, .pdr-t td:last-child { padding-right: 8px; } .pdr-t td.ach { font-size: 11.5px; } .pdr-t td.end small { display: block; font-size: 10px; color: var(--muted); }
.pdr-t tr.grp td { border-top: 1.5px solid var(--line); } .pdr-t tr.sub td { background: #f5f8ff; font-weight: 700; font-size: 11.5px; color: #1e3a8a; }
.pdr-t tr.tot td { background: #dbeafe; font-weight: 800; color: #1e3a8a; } .pdr-t td.l em.sup + b { margin-top: 1px; }
.pdr-t.cut td.l { width: 30%; } .pdr-t.cut .fab { width: 52%; text-align: left; font-size: 11.5px; line-height: 1.3; } .pdr-t.cut td:last-child { width: 18%; }
.pdr-t tr.ov td { font-size: 11.5px; color: #5b21b6; background: #faf8ff; padding-top: 3px; padding-bottom: 5px; border-top: 0; } .pdr-t tr.ov td.l { font-weight: 700; } .pdr-t tr.ov td.neg { color: var(--bad); }
.pdr-t.st .l { width: 40%; } .pdr-h .pdr-mt { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.pdr-wk { margin: 0 0 8px; } .pdr-wk button { min-height: 32px; font-size: 13px; }
.pdr-sec { display: flex; align-items: center; gap: 8px; margin: 14px 2px 8px; } .pdr-sec b { font-size: 15px; color: #1e3a8a; } .pdr-sec span { flex: 1; font-size: 12px; color: var(--muted); } .pdr-sec .btn.small { margin: 0; min-height: 28px; padding: 3px 10px; }
.rp-sum b.ach.ok { color: #15803d; } .rp-sum b.ach.mid { color: #b45309; } .rp-sum b.ach.low { color: #c81e1e; }
/* Approve tab: yesterday's PDR card */
.pdr-cta { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-left: 3px solid var(--warn); }
.pdr-cta.ready { border-left-color: var(--ok); background: #f3fbf5; }
.pdr-cta > div { flex: 1; min-width: 0; display: flex; flex-direction: column; } .pdr-cta b { font-size: 14px; } .pdr-cta span { font-size: 12px; color: var(--muted); }
.pdr-cta .btn.small { margin: 0; flex: none; }
.pdr-t td.l em.sup { display: block; font-style: normal; font-size: 10.5px; font-weight: 700; color: #475569; }

/* attendance card: tap Manpower -> designations under it */
body.phone .pl-mpc { position: relative; }
body.phone .pl-mp { all: unset; display: block; width: 100%; cursor: pointer; -webkit-tap-highlight-color: transparent; }
body.phone .pl-mp small { color: var(--primary); }
body.phone .pl-pop { position: absolute; top: calc(100% + 4px); left: -4px; z-index: 30; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(15,23,42,.18); padding: 6px 10px 4px; min-width: 200px; }
body.phone .pl-pop table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
body.phone .pl-pop th { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; text-align: right; padding: 2px 0 4px 10px; } body.phone .pl-pop th:first-child { text-align: left; padding-left: 0; }
body.phone .pl-pop td { font-size: 13.5px; text-align: right; padding: 4px 0 4px 10px; border-top: 1px solid #f0f2f6; white-space: nowrap; } body.phone .pl-pop td:first-child { text-align: left; padding-left: 0; }
body.phone .pl-pop td.chg { color: var(--bad); font-weight: 700; }
body.phone .pl-pop tfoot td { font-weight: 800; border-top: 1.5px solid var(--line); }
.mo-card.early { opacity: .75; background: #f8fafc; } .mo-card.early .st { color: var(--muted); font-weight: 600; }
.fix-btn { width: 100%; margin: 0 0 10px; font-size: 13.5px; min-height: 38px; }
.fx-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; margin: 0 0 8px; }
.fx-redo { flex: 1 1 100%; margin: 2px 0 0; text-align: left; display: flex; flex-direction: column; align-items: flex-start; } .fx-redo small { font-size: 11px; font-weight: 500; color: var(--muted); } .fx-row > div:first-child { flex: 1; min-width: 0; } .fx-row small { display: block; font-size: 12px; color: var(--muted); }
.fx-edit { display: flex; gap: 6px; align-items: center; } .fx-edit input { width: 90px; font-size: 18px; font-weight: 700; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; text-align: right; } .fx-edit .btn { margin: 0; }
.fx-why { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
