/* Employee portal + admin — same palette and type as the public site. */
:root {
  --paper: #F2F4F6;
  --paper-2: #E9EDF1;
  --white: #FFFFFF;
  --ink: #13203A;
  --ink-2: #2C3850;
  --mute: #5B6678;
  --rule: #D3D9E0;
  --red: #C8102E;
  --red-dark: #A00D25;
  --green: #17804A;
  --amber: #A86200;
  --display: 'Darker Grotesque', 'Arial Narrow', sans-serif;
  --body: 'Be Vietnam Pro', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
[hidden] { display: none !important; }
.display { font-family: var(--display); font-weight: 900; letter-spacing: -.02em; line-height: .92; margin: 0; }
.eyebrow { font: 500 11.5px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--mute); margin: 0; }
.mono { font-family: var(--mono); }
.muted { color: var(--mute); }
.brand { font: 900 24px/1 var(--display); letter-spacing: -.01em; text-decoration: none; white-space: nowrap; }
.brand b { color: var(--red); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border: 0; border-radius: 6px; background: var(--red); color: #fff; font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; transition: background .2s, transform .15s var(--ease), opacity .2s; }
.btn:hover { background: var(--red-dark); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.dark { background: var(--ink); }
.btn.dark:hover { background: #0A1428; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--rule); }
.btn.ghost:hover { background: var(--white); border-color: var(--ink); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 13.5px; }
.btn.block { width: 100%; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--red); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* form fields */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field .hint { font-size: 12.5px; color: var(--mute); }
.input, .field input, .field select, .field textarea { width: 100%; min-height: 46px; padding: 11px 13px; font: 400 16px/1.3 var(--body); color: var(--ink); background: var(--white); border: 1px solid var(--rule); border-radius: 6px; transition: border-color .2s, box-shadow .2s; }
.field input[readonly] { background: var(--paper-2); color: var(--mute); }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(19, 32, 58, .12); }
.pw { position: relative; }
.pw input { padding-right: 64px; }
.pw button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); height: 34px; padding: 0 10px; border: 0; background: var(--paper-2); border-radius: 4px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.stack { display: grid; gap: 14px; }
.error { color: var(--red); font-size: 14px; margin: 0; min-height: 1em; }
.notice { padding: 12px 14px; border-radius: 6px; background: var(--white); border: 1px solid var(--rule); border-left: 3px solid var(--red); font-size: 14px; color: var(--ink-2); }

/* cards */
.card { background: var(--white); border: 1px solid var(--rule); border-radius: 10px; padding: 18px; }
.card h2, .card h3 { margin: 0 0 4px; }
.section-title { font: 800 22px/1.05 var(--display); margin: 0 0 12px; letter-spacing: -.005em; }

/* language switch */
.lang-switch { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--paper-2); gap: 2px; }
.lang-switch button { border: 0; background: transparent; min-width: 34px; height: 28px; border-radius: 999px; font: 600 12px/1 var(--mono); color: var(--mute); cursor: pointer; transition: background .2s, color .2s; }
.lang-switch button[aria-pressed="true"] { background: var(--white); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.login .lang-switch { position: absolute; top: 18px; right: 18px; }
.login main { position: relative; }

/* document library */
.file-list { display: grid; gap: 10px; }
.file-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--white); border: 1px solid var(--rule); border-radius: 10px; text-decoration: none; transition: border-color .2s, transform .2s var(--ease); }
.file-item:hover { border-color: var(--ink); transform: translateY(-1px); }
.file-item .ic { flex: none; width: 42px; height: 42px; border-radius: 8px; background: #FBF2F4; display: grid; place-items: center; font: 600 10.5px/1 var(--mono); color: var(--red); text-transform: uppercase; }
.file-item .meta { min-width: 0; flex: 1; }
.file-item .meta strong { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .meta span { font-size: 12.5px; color: var(--mute); }
.file-item .dl { font-size: 13px; font-weight: 600; color: var(--red); white-space: nowrap; }
.file-group { margin: 18px 0 8px; }

/* two-step verification */
.mfa-steps { list-style: none; margin: 0; padding: 0; counter-reset: s; display: grid; gap: 18px; }
.mfa-steps > li { counter-increment: s; display: grid; gap: 6px; padding-left: 40px; position: relative; }
.mfa-steps > li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font: 600 13px/1 var(--mono); }
.mfa-steps span { color: var(--mute); font-size: 14px; }
.mfa-steps .qr { display: block; width: 184px; height: 184px; padding: 6px; background: #fff; border: 1px solid var(--rule); border-radius: 8px; }
.mfa-steps .qr svg { width: 100%; height: 100%; display: block; }
.mfa-form { display: flex; gap: 8px; max-width: 320px; }
.code-input { font: 600 20px/1 var(--mono) !important; letter-spacing: .2em; text-align: center; }
.status-chip { text-transform: none; }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(86px + var(--safe-b)); transform: translate(-50%, 20px); opacity: 0; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 8px; font-size: 14px; z-index: 100; transition: opacity .3s, transform .35s var(--ease); max-width: calc(100vw - 32px); box-shadow: 0 12px 30px -12px rgba(0,0,0,.5); }
.toast.err { background: var(--red); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* skeleton loading */
.skeleton { background: linear-gradient(90deg, var(--paper-2) 25%, #F7F8FA 50%, var(--paper-2) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.rise { animation: rise .45s var(--ease) both; }

/* ---------- login ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.login aside { background: var(--ink); color: #fff; padding: 40px clamp(24px, 5vw, 64px); display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login aside::after { content: ""; position: absolute; width: 520px; height: 520px; right: -200px; bottom: -220px; border-radius: 50%; background: radial-gradient(circle, rgba(200, 16, 46, .35), transparent 65%); }
.login aside .brand { color: #fff; }
.login aside h1 { font-size: clamp(44px, 5vw, 72px); margin: 0 0 18px; position: relative; z-index: 1; }
.login aside h1 em { font-style: normal; color: #FF5A72; }
.login aside p { color: #C6CEDB; max-width: 420px; position: relative; z-index: 1; margin: 0; }
.login aside ul { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 10px; position: relative; z-index: 1; color: #DCE2EC; font-size: 14.5px; }
.login aside li::before { content: "✓"; color: #FF8A9B; margin-right: 10px; }
.login main { display: flex; align-items: center; justify-content: center; padding: 32px 20px calc(32px + var(--safe-b)); }
.login form { width: 100%; max-width: 400px; display: grid; gap: 16px; }
.login form h2 { font: 900 38px/.95 var(--display); margin: 0; letter-spacing: -.01em; }
.login .help { font-size: 13.5px; color: var(--mute); border-top: 1px solid var(--rule); padding-top: 16px; }
.login .help a { color: var(--ink); font-weight: 600; }
.login .back { font-size: 13.5px; color: var(--mute); text-decoration: none; }
.login .back:hover { color: var(--ink); }
.mobile-brand { display: none; }

/* ---------- employee app ---------- */
.app { min-height: 100vh; min-height: 100dvh; padding-bottom: calc(76px + var(--safe-b)); }
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(242, 244, 246, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule); }
.topbar .in { max-width: 760px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 58px; padding: 0 16px; }
.topbar .client { font-size: 12px; color: var(--mute); text-align: right; line-height: 1.3; max-width: 34vw; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
@media (max-width: 420px) { .topbar .client { display: none; } }
.topbar .menu-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--rule); background: var(--white); display: grid; place-items: center; cursor: pointer; font-weight: 700; font-size: 14px; }
.content { max-width: 760px; margin: 0 auto; padding: 18px 16px 24px; }
.hello { margin: 4px 0 18px; }
.hello h1 { font-size: 36px; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--white); border-top: 1px solid var(--rule); padding-bottom: var(--safe-b); }
.tabbar .in { max-width: 760px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); }
.tabbar button { background: none; border: 0; padding: 9px 4px 10px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 12px; font-weight: 500; color: var(--mute); cursor: pointer; position: relative; }
.tabbar button svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar button[aria-current="page"] { color: var(--ink); }
.tabbar button[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--red); }
.tabbar .dot { position: absolute; top: 7px; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; background: var(--red); }

/* menu sheet */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(19, 32, 58, .45); z-index: 40; opacity: 0; transition: opacity .25s; }
.sheet-backdrop.open { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: var(--white); border-radius: 16px 16px 0 0; padding: 10px 16px calc(18px + var(--safe-b)); transform: translateY(100%); transition: transform .32s var(--ease); max-height: 92vh; overflow: auto; }
.sheet.open { transform: none; }
.sheet .grip { width: 40px; height: 4px; border-radius: 2px; background: var(--rule); margin: 4px auto 14px; }
.sheet-list { display: grid; }
.sheet-list button, .sheet-list a { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 4px; border: 0; border-bottom: 1px solid var(--rule); background: none; text-align: left; font-size: 15.5px; cursor: pointer; text-decoration: none; }
@media (min-width: 761px) { .sheet { left: 50%; right: auto; width: 440px; bottom: auto; top: 50%; border-radius: 14px; transform: translate(-50%, -40%); opacity: 0; transition: transform .3s var(--ease), opacity .25s; pointer-events: none; } .sheet.open { transform: translate(-50%, -50%); opacity: 1; pointer-events: auto; } }

/* onboarding steps */
.steps { display: flex; gap: 8px; margin-bottom: 16px; }
.steps span { flex: 1; height: 4px; border-radius: 2px; background: var(--rule); }
.steps span.on { background: var(--red); }

/* upload slots */
.mode { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; background: var(--paper-2); border-radius: 8px; margin-bottom: 14px; }
.mode button { min-height: 40px; border: 0; border-radius: 6px; background: transparent; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--mute); transition: background .2s, color .2s; }
.mode button[aria-pressed="true"] { background: var(--white); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.slots.one { grid-template-columns: minmax(0, 1fr); }
.slot { position: relative; aspect-ratio: 1.58; border: 2px dashed var(--rule); border-radius: 10px; background: var(--white); display: grid; place-items: center; text-align: center; cursor: pointer; overflow: hidden; transition: border-color .2s, background .2s; }
.slots.one .slot { aspect-ratio: auto; min-height: 220px; }
.slot:hover { border-color: var(--ink); }
.slot input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.slot .ph { padding: 10px; font-size: 13.5px; color: var(--mute); pointer-events: none; }
.slot .ph strong { display: block; color: var(--ink); font-size: 14.5px; margin-bottom: 2px; }
.slot .ph svg { width: 28px; height: 28px; stroke: var(--red); fill: none; stroke-width: 1.8; margin: 0 auto 6px; display: block; }
.slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slot .state { position: absolute; left: 8px; bottom: 8px; background: rgba(19,32,58,.85); color: #fff; font-size: 12px; padding: 4px 8px; border-radius: 4px; pointer-events: none; }
.slot.done { border-style: solid; border-color: var(--green); }
.slot.done .state { background: var(--green); }
.slot.busy::after { content: ""; position: absolute; inset: 0; background: rgba(255,255,255,.6); }

/* payslips */
.slip-list { display: grid; gap: 10px; }
.slip-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; background: var(--white); border: 1px solid var(--rule); border-radius: 10px; cursor: pointer; text-align: left; width: 100%; transition: border-color .2s, transform .2s var(--ease), box-shadow .2s; }
.slip-item:hover { border-color: var(--ink); transform: translateY(-1px); box-shadow: 0 10px 24px -18px rgba(19,32,58,.6); }
.slip-item .m { display: block; font: 800 23px/1 var(--display); }
.slip-item .n { display: block; font: 500 16px/1.2 var(--mono); }
.slip-item .l { display: block; font-size: 12px; color: var(--mute); margin-top: 5px; }
.empty { text-align: center; padding: 40px 16px; color: var(--mute); }
.empty svg { width: 48px; height: 48px; stroke: var(--rule); fill: none; stroke-width: 1.5; margin: 0 auto 10px; display: block; }
.payslip { background: var(--white); border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; }
.payslip .ph { background: var(--ink); color: #fff; padding: 18px; }
.payslip .ph .eyebrow { color: #9AA6BA; }
.payslip .ph h2 { font: 900 34px/1 var(--display); margin: 6px 0 2px; }
.payslip .ph .who { font-size: 13.5px; color: #C6CEDB; }
.payslip .net { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 18px; border-bottom: 1px solid var(--rule); background: #FBF2F4; }
.payslip .net strong { font: 900 32px/1 var(--display); color: var(--red); letter-spacing: -.01em; }
.payslip .grp { padding: 14px 18px 6px; }
.payslip .grp h3 { margin: 0 0 6px; font: 500 11.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--mute); }
.payslip .row { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px dashed var(--rule); font-size: 14.5px; }
.payslip .row:last-child { border-bottom: 0; }
.payslip .row span:last-child { font-family: var(--mono); font-size: 14px; white-space: nowrap; }
.payslip .row.total { font-weight: 600; border-top: 1px solid var(--ink); border-bottom: 0; }
.payslip .foot { padding: 12px 18px 16px; font-size: 12px; color: var(--mute); border-top: 1px solid var(--rule); }
.back-link { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 6px 0; margin-bottom: 10px; font-weight: 600; cursor: pointer; color: var(--ink-2); }

/* profile */
.profile-group { margin-bottom: 16px; }
.profile-group h3 { margin: 0 0 12px; font: 500 11.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--red); }
.save-bar { position: sticky; bottom: calc(70px + var(--safe-b)); padding: 10px 0; background: linear-gradient(transparent, var(--paper) 30%); }
.ro-list { display: grid; }
.ro-list div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: 14px; }
.ro-list div span:first-child { color: var(--mute); }
.ro-list div span:last-child { text-align: right; font-weight: 500; }

/* ---------- admin ---------- */
.admin-top { background: var(--ink); color: #fff; }
.admin-top .in { max-width: 1320px; margin: 0 auto; height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 20px; }
.admin-top .brand { color: #fff; }
.admin-top nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.admin-top nav::-webkit-scrollbar { display: none; }
.admin-top nav button { white-space: nowrap; }
.admin-top .lang-switch { background: rgba(255,255,255,.1); }
.admin-top .lang-switch button { color: #C6CEDB; }
.admin-top .lang-switch button[aria-pressed="true"] { background: #fff; color: var(--ink); }
.admin-top nav button { background: none; border: 0; color: #C6CEDB; padding: 8px 12px; border-radius: 6px; cursor: pointer; font-weight: 500; }
.admin-top nav button[aria-current="page"], .admin-top nav button:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11.5px; font-weight: 700; }
.admin-wrap { max-width: 1320px; margin: 0 auto; padding: 20px; display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
.client-list { display: grid; gap: 6px; }
.client-list button { text-align: left; background: var(--white); border: 1px solid var(--rule); border-radius: 8px; padding: 12px 14px; cursor: pointer; transition: border-color .2s; }
.client-list button:hover { border-color: var(--ink); }
.client-list button[aria-current="true"] { border-color: var(--red); box-shadow: inset 3px 0 0 var(--red); }
.client-list .cn { font-weight: 600; display: block; }
.client-list .cc { font-size: 12.5px; color: var(--mute); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; font-weight: 600; color: var(--mute); cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--red); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar .grow { flex: 1; min-width: 160px; }
.table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--rule); border-radius: 10px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font: 500 11px/1.3 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--mute); padding: 11px 12px; border-bottom: 1px solid var(--rule); background: #FAFBFC; white-space: nowrap; }
table.t td { padding: 11px 12px; border-bottom: 1px solid var(--paper-2); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr.click { cursor: pointer; }
table.t tbody tr.click:hover { background: #FAFBFC; }
table.t td.num { font-family: var(--mono); font-size: 13px; white-space: nowrap; text-align: right; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); white-space: nowrap; }
.chip.ok { background: #E3F4EA; color: var(--green); }
.chip.warn { background: #FFF1DD; color: var(--amber); }
.chip.bad { background: #FCE6EA; color: var(--red); }
.modal-backdrop { position: fixed; inset: 0; background: rgba(19, 32, 58, .5); z-index: 50; display: flex; justify-content: flex-end; }
.drawer { width: min(680px, 100vw); height: 100%; background: var(--paper); overflow: auto; animation: slideIn .32s var(--ease); display: flex; flex-direction: column; }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } }
.drawer header { position: sticky; top: 0; z-index: 2; background: var(--white); border-bottom: 1px solid var(--rule); padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.drawer .body { padding: 18px; display: grid; gap: 16px; }
.doc-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.doc-thumbs a { display: block; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; background: var(--white); text-decoration: none; font-size: 12.5px; }
.doc-thumbs img { width: 100%; aspect-ratio: 1.58; object-fit: cover; display: block; background: var(--paper-2); }
.doc-thumbs span { display: block; padding: 6px 8px; }
.report { font-size: 14px; display: grid; gap: 6px; }
.report .ok { color: var(--green); }
.report .bad { color: var(--red); }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kv div { background: var(--white); border: 1px solid var(--rule); border-radius: 8px; padding: 12px; }
.kv strong { display: block; font: 900 26px/1 var(--display); margin-top: 4px; }

@media (max-width: 1100px) {
  .admin-top .in { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 8px; row-gap: 6px; }
  .admin-top nav { order: 3; width: 100%; }
}
@media (max-width: 900px) {
  .admin-wrap { grid-template-columns: minmax(0, 1fr) !important; }
}
@media (max-width: 760px) {
  .login { grid-template-columns: 1fr; }
  .login aside { display: none; }
  .mobile-brand { display: block; margin-bottom: 8px; }
  .grid2 { grid-template-columns: 1fr; }
  .admin-top nav button { padding: 8px 8px; font-size: 13.5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
  .topbar, .tabbar, .back-link, .no-print, .toast { display: none !important; }
  .app { padding: 0; }
  body { background: #fff; }
  .payslip { border: 0; }
  .payslip .ph { background: #fff; color: #000; border-bottom: 2px solid #000; }
  .payslip .ph .eyebrow, .payslip .ph .who { color: #333; }
}

/* ---------- messaging ---------- */
.thread-list { display: grid; gap: 8px; }
.thread-item { display: grid; gap: 4px; padding: 14px 16px; background: var(--white); border: 1px solid var(--rule); border-radius: 10px; text-decoration: none; transition: border-color .2s, transform .2s var(--ease); position: relative; }
.thread-item:hover { border-color: var(--ink); transform: translateY(-1px); }
.thread-item.unread { border-left: 3px solid var(--red); }
.thread-item.unread .ti-subject::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--red); margin-left: 8px; vertical-align: 2px; }
.ti-top { display: flex; gap: 6px; align-items: center; }
.ti-time { margin-left: auto; font-size: 12px; color: var(--mute); }
.ti-subject { font-size: 15.5px; }
.ti-who { font-size: 13px; color: var(--ink-2); }
.ti-last { font-size: 13.5px; color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 58vh; overflow-y: auto; padding: 14px; background: var(--white); border: 1px solid var(--rule); border-radius: 12px; margin: 12px 0; }
.bubble { max-width: 82%; align-self: flex-start; background: var(--paper); border-radius: 12px 12px 12px 4px; padding: 10px 12px; font-size: 14.5px; }
.bubble.nk { background: #EEF2F8; }
.bubble.mine { align-self: flex-end; background: var(--ink); color: #fff; border-radius: 12px 12px 4px 12px; }
.bubble.mine .b-meta, .bubble.mine .muted { color: #9AA6BA; }
.b-meta { font-size: 11.5px; color: var(--mute); margin-bottom: 3px; }
.b-body { white-space: normal; overflow-wrap: anywhere; }
.bubble .att { display: block; margin-top: 8px; font-size: 13.5px; color: inherit; }
.bubble .att img { max-width: 220px; max-height: 220px; border-radius: 8px; display: block; }
.reply { display: flex; gap: 8px; align-items: flex-end; }
.reply textarea { flex: 1; min-height: 46px; max-height: 160px; resize: vertical; font: 400 15px/1.4 var(--body); padding: 11px 12px; border: 1px solid var(--rule); border-radius: 8px; background: var(--white); color: var(--ink); }
.reply textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(19,32,58,.12); }
.attach-btn { min-height: 46px; cursor: pointer; }

/* ---------- notification bell ---------- */
.bell { position: relative; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--rule); background: var(--white); display: grid; place-items: center; cursor: pointer; color: var(--ink); flex: none; }
.bell svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.admin-top .bell { background: rgba(255,255,255,.1); border-color: transparent; color: #fff; }
.bell-badge { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font: 700 11px/18px var(--body); text-align: center; }
.bell-panel { position: fixed; z-index: 60; width: min(360px, calc(100vw - 16px)); max-height: 70vh; overflow: auto; background: var(--white); border: 1px solid var(--rule); border-radius: 12px; box-shadow: 0 20px 50px -20px rgba(19,32,58,.45); }
.bp-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--rule); position: sticky; top: 0; background: var(--white); }
.bp-item { display: grid; gap: 2px; padding: 11px 14px; border-bottom: 1px solid var(--paper-2); text-decoration: none; font-size: 14px; }
.bp-item.unread { background: #FBF2F4; }
.bp-item .muted { font-size: 12px; }
.nav-badge.dot { margin-left: 4px; }
.tabbar .nav-badge.dot { position: absolute; top: 4px; left: calc(50% + 6px); margin: 0; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }

/* ---------- misc ---------- */
.banner { padding: 12px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }
.banner.warn { background: #FFF1DD; color: #6B4300; }
.banner.info { background: #EEF2F8; color: var(--ink-2); }
.slip-item.hidden-slip { cursor: default; opacity: .85; }
.rev-badge { display: inline-block; font: 600 11px/1 var(--mono); color: var(--red); border: 1px solid currentColor; border-radius: 4px; padding: 3px 6px; margin-left: 8px; vertical-align: 3px; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.mini-table td, .mini-table th { padding: 8px 6px; border-bottom: 1px solid var(--rule); text-align: left; }
@media (max-width: 760px) { .tabbar button { font-size: 11px; } .bubble { max-width: 92%; } }
/* ---------- admin dashboard ---------- */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 14px; align-items: start; }
.thread-list.compact .thread-item { padding: 10px 12px; }
.mini-table tr.click { cursor: pointer; }
.mini-table tr.click:hover td { background: var(--paper-2); }
/* ---------- ID camera ---------- */
.idcam { position: fixed; inset: 0; z-index: 90; background: #000; color: #fff; overflow: hidden; }
.idcam video, .idcam .idcam-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.idcam .idcam-preview { object-fit: contain; background: #000; z-index: 2; padding: 90px 16px 140px; box-sizing: border-box; }
.idcam-mask { position: absolute; inset: 0; display: grid; place-items: center; padding-bottom: 60px; pointer-events: none; }
.idcam.review .idcam-mask { display: none; }
.idcam-frame { position: relative; width: min(88vw, 640px, calc((100vh - 280px) * 1.585)); aspect-ratio: 85.6 / 54; border-radius: 14px; box-shadow: 0 0 0 200vmax rgba(8, 12, 22, .62); outline: 1.5px solid rgba(255,255,255,.55); }
.idcam-frame i { position: absolute; width: 26px; height: 26px; border: 4px solid #fff; }
.idcam-frame i:nth-child(1) { top: -3px; left: -3px; border-right: 0; border-bottom: 0; border-top-left-radius: 14px; }
.idcam-frame i:nth-child(2) { top: -3px; right: -3px; border-left: 0; border-bottom: 0; border-top-right-radius: 14px; }
.idcam-frame i:nth-child(3) { bottom: -3px; left: -3px; border-right: 0; border-top: 0; border-bottom-left-radius: 14px; }
.idcam-frame i:nth-child(4) { bottom: -3px; right: -3px; border-left: 0; border-top: 0; border-bottom-right-radius: 14px; }
.idcam-top { position: absolute; z-index: 3; top: 0; left: 0; right: 0; display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; padding: max(12px, env(safe-area-inset-top)) 12px 12px; text-align: center; font-size: 16px; }
.idcam-x { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 28px; line-height: 1; cursor: pointer; }
.idcam-hint, .idcam-msg { position: absolute; z-index: 3; left: 20px; right: 20px; top: calc(50% - 30px + min(88vw, 640px, calc((100vh - 280px) * 1.585)) / 3.17 + 18px); margin: 0; text-align: center; font-size: 14.5px; line-height: 1.45; color: rgba(255,255,255,.92); }
.idcam-msg { top: 38%; background: rgba(255,255,255,.1); padding: 14px; border-radius: 10px; }
.idcam.review .idcam-hint { display: none; }
.idcam-bar { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 18px 16px max(22px, env(safe-area-inset-bottom)); }
.idcam-pick { justify-self: start; background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 999px; padding: 10px 14px; font: 600 13.5px/1.2 var(--body); cursor: pointer; }
.idcam-shutter { width: 74px; height: 74px; border-radius: 50%; border: 4px solid #fff; background: transparent; padding: 5px; cursor: pointer; }
.idcam-shutter span { display: block; width: 100%; height: 100%; border-radius: 50%; background: #fff; transition: transform .1s; }
.idcam-shutter:active span { transform: scale(.9); }
.idcam-shutter:disabled { opacity: .35; }
.idcam-confirm { grid-template-columns: 1fr 1fr; }
.idcam-confirm .btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
/* ---------- admin viewing an employee's account ---------- */
.viewas-bar { position: fixed; z-index: 80; top: 0; left: 0; right: 0; height: 40px; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 0 12px; background: #F5B83D; color: #13203A; font-size: 13.5px; }
.viewas-bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewas-bar button { flex: none; border: 0; border-radius: 999px; padding: 6px 14px; background: #13203A; color: #fff; font: 600 13px/1 var(--body); cursor: pointer; }
body.viewing-as { padding-top: 40px; }
body.viewing-as .topbar { top: 40px; }
.doc-sec { font-size: 19px; margin: 22px 0 10px; }
.hello + .doc-sec { margin-top: 4px; }
#idcard { scroll-margin-top: 74px; }
