/* Hangova Payroll: sidebar on desktop, bottom tabs on phones */
:root {
  --ink: #1f1510; --cocoa: #21140c; --cocoa-2: #2f1f15; --gold: #c99a4e; --gold-2: #e8c27c; --gold-soft: #fbf1de;
  --bg: #f6f3ee; --paper: #fff; --muted: #7a6a5c; --line: #ece4d8; --line-2: #f3ede4;
  --green: #17864a; --green-bg: #e3f4ea; --red: #c0392b; --red-bg: #fbe8e5; --amber: #b7791f; --amber-bg: #fdf0d8;
  --blue: #2563c9; --blue-bg: #e6eefb; --grey-bg: #f0ece6;
  --r: 16px; --shadow: 0 1px 2px rgba(33, 20, 12, .04), 0 6px 20px rgba(33, 20, 12, .05);
  --f: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 15px/1.5 var(--f); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1 { font-size: clamp(22px, 3vw, 28px); line-height: 1.2; margin: 0; letter-spacing: -.02em; font-weight: 800; }
h2 { font-size: 16px; margin: 0; font-weight: 700; }
h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 20px 0 8px; }
h3 small { text-transform: none; letter-spacing: 0; font-weight: 500; }
a { color: #8a5a12; }
[hidden] { display: none !important; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.mt { margin-top: 18px; }
.fine { font-size: 12px; color: var(--muted); margin: 16px 0 0; }

.loading { display: grid; place-items: center; height: 100vh; margin: 0; }
.spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--gold); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- forms and buttons ---------- */
label { display: block; font-size: 13px; font-weight: 600; margin: 0 0 12px; color: #4a3a2e; }
input, select { display: block; width: 100%; margin-top: 5px; font: 15px var(--f); padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
input:focus, select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 154, 78, .18); }
input:disabled, select:disabled { background: #faf8f5; color: #5d4d40; }
input.up { text-transform: uppercase; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }
@media (max-width: 560px) { .two { grid-template-columns: 1fr; } .three { grid-template-columns: 1fr 1fr; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 10px; border: 0; font: 700 14px var(--f); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn-gold { background: var(--cocoa); color: #fff; }
.btn-gold:hover { background: var(--cocoa-2); }
.btn-line { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn-line:hover { border-color: var(--gold); }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.btn-block { width: 100%; margin-top: 10px; }
.btn:disabled { opacity: .55; cursor: default; }
.link { border: 0; background: none; padding: 0; font: inherit; color: #8a5a12; font-weight: 600; cursor: pointer; }
.link:hover { text-decoration: underline; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); font-size: 20px; cursor: pointer; flex: none; }
.err { color: var(--red); font-size: 13px; margin: 4px 0 8px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 16px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--grey-bg); color: #5d4d40; white-space: nowrap; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .8; }
.chip.plain::before { display: none; }
.chip.present { background: var(--green-bg); color: var(--green); }
.chip.late, .chip.half { background: var(--amber-bg); color: var(--amber); }
.chip.absent { background: var(--red-bg); color: var(--red); }
.chip.leave { background: var(--blue-bg); color: var(--blue); }
.chip.off, .chip.none, .chip.left { background: var(--grey-bg); color: #8a7b6e; }
.chip.gold { background: var(--gold-soft); color: #8a5a12; }

.avatar { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; font-weight: 700; font-size: 14px; color: #fff; flex: none; background: var(--gold); text-transform: uppercase; letter-spacing: .02em; }
.avatar.sm { width: 34px; height: 34px; font-size: 13px; }

/* ---------- sign in gate ---------- */
.gate { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 44%) 1fr; }
.gate-brand { background: radial-gradient(120% 80% at 0% 0%, #4a2f1d 0%, var(--cocoa) 60%); color: #fff; padding: 40px 48px; display: flex; flex-direction: column; }
.gate-brand h1 { font-size: clamp(28px, 3.4vw, 42px); margin: auto 0 22px; max-width: 14ch; line-height: 1.12; }
.gate-brand h1 em { font-style: normal; color: var(--gold-2); }
.gate-points { list-style: none; padding: 0; margin: 0 0 auto; display: grid; gap: 14px; font-size: 15.5px; color: #f1e6d6; }
.gate-points i { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, .08); margin-right: 12px; font-style: normal; color: var(--gold-2); }
.gate-fine { font-size: 13px; color: #bca78f; margin: 28px 0 0; }
.gate-main { display: grid; place-items: center; padding: 32px 20px; }
.gate-card { width: min(420px, 100%); background: var(--paper); border-radius: 20px; padding: 30px 28px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.gate-card.wide { width: min(560px, 100%); }
.gate-card h2 { font-size: 22px; margin-bottom: 6px; letter-spacing: -.01em; }
.gate-card > p.muted { margin: 0 0 18px; }
.gate-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 14px 0 0; }
.big-ico { font-size: 40px; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 17px; color: #fff; }
.logo img { width: 34px; height: 34px; border-radius: 9px; }
.logo b { color: var(--gold-2); }
@media (max-width: 860px) {
  .gate { grid-template-columns: 1fr; }
  .gate-brand { padding: 22px 20px 26px; }
  .gate-brand h1 { margin: 22px 0 14px; font-size: 26px; max-width: none; }
  .gate-points { font-size: 14px; gap: 8px; }
  .gate-points i { width: 28px; height: 28px; margin-right: 10px; }
  .gate-fine { margin-top: 16px; }
  .gate-main { place-items: start center; padding: 18px 16px 40px; }
  .gate-card { padding: 24px 20px; }
}

.co-list { display: grid; gap: 10px; margin: 16px 0; }
.co-card { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; font: inherit; color: inherit; cursor: pointer; }
.co-card:hover { border-color: var(--gold); }
.co-card .grow { flex: 1; min-width: 0; }
.co-card b { display: block; font-size: 15.5px; }
.co-card span.sub { font-size: 13px; color: var(--muted); }
.co-new { border: 1.5px dashed var(--line); border-radius: 14px; padding: 4px 16px; }
.co-new[open] { padding-bottom: 16px; }
.co-new summary { cursor: pointer; font-weight: 700; padding: 12px 0; color: #8a5a12; list-style: none; }
.co-new summary::-webkit-details-marker { display: none; }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; background: var(--cocoa); color: #e9dccb; padding: 18px 14px; }
.side .logo { padding: 2px 8px 14px; }
.co-switch { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .05); color: #fff; font: 600 14px var(--f); cursor: pointer; margin-bottom: 10px; }
.co-switch:hover { background: rgba(255, 255, 255, .09); }
.co-switch span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-switch span::after { content: " ⌄"; color: var(--gold-2); }
.co-switch small { color: #bca78f; font-weight: 500; font-size: 12px; }
.nav { display: grid; gap: 2px; }
.nav button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: none; color: #d8c8b4; font: 600 14.5px var(--f); cursor: pointer; text-align: left; }
.nav button:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav button.is-on { background: var(--gold-2); color: var(--cocoa); }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 6px 0; border-top: 1px solid rgba(255, 255, 255, .08); }
.side-foot div { flex: 1; min-width: 0; }
.side-foot b, .side-foot small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot b { color: #fff; font-size: 13.5px; }
.side-foot small { color: #bca78f; font-size: 12px; }
.side-foot .icon-btn { background: transparent; border-color: rgba(255, 255, 255, .14); color: #e9dccb; }

.main { min-width: 0; padding: 26px clamp(16px, 3vw, 36px) 60px; max-width: 1180px; width: 100%; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.top-co { display: none; margin: 0 0 4px; font-size: 12.5px; font-weight: 700; color: #8a5a12; text-transform: uppercase; letter-spacing: .06em; }
.top .muted { margin: 4px 0 0; }
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.tabbar { display: none; }
.mobile-only { display: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .main { padding: 18px 16px calc(92px + env(safe-area-inset-bottom)); }
  .top-co { display: block; cursor: pointer; }
  .top-co::after { content: " ⌄"; }
  .mobile-only { display: block; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: #fff; border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; border: 0; background: none; font: 600 11px var(--f); color: #8a7b6e; cursor: pointer; }
  .tabbar button.is-on { color: var(--cocoa); }
  .tabbar button.is-on svg { color: #8a5a12; }
  .tabbar svg { width: 22px; height: 22px; }
}

/* ---------- cards ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.grid2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; align-items: start; }
.grid2 > .card { margin-bottom: 0; }
@media (max-width: 980px) { .grid2 { grid-template-columns: 1fr; } }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; font-size: 14px; }
.note-card { background: var(--gold-soft); border: 1px solid #f0d9a8; border-radius: var(--r); padding: 16px 18px; margin: 0 0 16px; }
.plan-note { background: var(--gold-soft); border: 1px solid #f0d9a8; border-radius: 12px; padding: 10px 14px; font-size: 13.5px; margin: 0 0 14px; }

/* dashboard */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
@media (max-width: 980px) { .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); display: flex; gap: 14px; align-items: center; min-width: 0; }
.stat .ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; flex: none; }
.stat .ico.g { background: var(--green-bg); color: var(--green); }
.stat .ico.a { background: var(--amber-bg); color: var(--amber); }
.stat .ico.b { background: var(--blue-bg); color: var(--blue); }
.stat .ico.c { background: var(--gold-soft); color: #8a5a12; }
.stat b { display: block; font-size: 24px; line-height: 1.1; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat b small { font-size: 14px; color: var(--muted); font-weight: 600; }
.stat span { font-size: 13px; color: var(--muted); }
@media (max-width: 560px) { .stat { padding: 14px; gap: 10px; } .stat .ico { width: 36px; height: 36px; } .stat b { font-size: 20px; } }

.people { display: grid; }
.person { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-2); }
.person:first-child { border-top: 0; }
.person .grow { flex: 1; min-width: 0; }
.person b { display: block; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person small { color: var(--muted); font-size: 12.5px; }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick button { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font: 600 13.5px var(--f); color: var(--ink); cursor: pointer; text-align: left; }
.quick button:hover { border-color: var(--gold); background: #fffcf6; }
.quick button svg { color: #8a5a12; }
.activity { list-style: none; padding: 0; margin: 0; }
.activity li { position: relative; padding: 0 0 12px 20px; font-size: 13.5px; }
.activity li::before { content: ""; position: absolute; left: 3px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.activity li::after { content: ""; position: absolute; left: 6.5px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.activity li:last-child::after { display: none; }
.activity small { display: block; color: var(--muted); font-size: 12px; }

/* check in */
.clock-card { background: radial-gradient(120% 90% at 50% 0%, #4a2f1d 0%, var(--cocoa) 70%); color: #fff; border-radius: 22px; padding: 26px 20px 22px; text-align: center; margin-bottom: 16px; box-shadow: var(--shadow); }
.clock-date { margin: 0; color: #d8c8b4; font-size: 14px; font-weight: 600; }
.clock { margin: 4px 0 2px; font-size: clamp(44px, 9vw, 64px); font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.05; }
.clock-shift { margin: 0 0 20px; color: var(--gold-2); font-size: 13.5px; min-height: 1.3em; }
.punch { position: relative; width: 168px; height: 168px; border-radius: 50%; border: 0; cursor: pointer; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: linear-gradient(160deg, #34c27a, #138449); color: #fff; font: 800 22px var(--f); box-shadow: 0 0 0 10px rgba(52, 194, 122, .14), 0 0 0 20px rgba(52, 194, 122, .07), 0 12px 30px rgba(0, 0, 0, .35); transition: transform .12s; }
.punch:active { transform: scale(.97); }
.punch small { font: 600 12.5px var(--f); opacity: .9; }
.punch.out { background: linear-gradient(160deg, #f07a5d, #c0392b); box-shadow: 0 0 0 10px rgba(240, 122, 93, .14), 0 0 0 20px rgba(240, 122, 93, .07), 0 12px 30px rgba(0, 0, 0, .35); }
.punch.done { background: linear-gradient(160deg, #6b5a4c, #4a3a2e); box-shadow: 0 0 0 10px rgba(255, 255, 255, .06), 0 12px 30px rgba(0, 0, 0, .3); cursor: default; }
.punch:disabled { cursor: default; }
.punch:disabled:not(.done) { opacity: .6; }
.today-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 26px auto 0; max-width: 460px; }
.today-row div { background: rgba(255, 255, 255, .07); border-radius: 12px; padding: 10px 6px; }
.today-row small { display: block; color: #bca78f; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.today-row b { font-size: 17px; font-variant-numeric: tabular-nums; }
.clock-card .err { color: #ffb4a8; margin-top: 12px; }
.mini-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.mini-stats div { border-radius: 12px; padding: 12px 14px; background: var(--grey-bg); }
.mini-stats div.g { background: var(--green-bg); }
.mini-stats div.a { background: var(--amber-bg); }
.mini-stats div.r { background: var(--red-bg); }
.mini-stats div.b { background: var(--blue-bg); }
.mini-stats b { display: block; font-size: 22px; }
.mini-stats span { font-size: 12.5px; color: #5d4d40; }
.log { list-style: none; padding: 0; margin: 0; }
.log li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line-2); font-size: 14px; }
.log li:first-child { border-top: 0; }
.log li span.t { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

/* attendance */
.day-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.day-bar input { width: auto; margin: 0; padding: 7px 10px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chips .chip { font-size: 13px; padding: 6px 12px; }
.att-list { display: grid; }
.att-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 18px; border: 0; border-top: 1px solid var(--line-2); background: #fff; font: inherit; color: inherit; text-align: left; }
.att-row:first-child { border-top: 0; }
button.att-row { cursor: pointer; }
button.att-row:hover { background: #fffcf6; }
.att-row .grow { flex: 1; min-width: 0; }
.att-row b { display: block; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-row small { color: var(--muted); font-size: 12.5px; }
.att-row .times { font-size: 13px; color: #5d4d40; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.att-row .times small { display: block; }
@media (max-width: 560px) { .att-row { padding: 12px 14px; gap: 10px; } .att-row .times { display: none; } }

/* employees */
.tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.tools input { flex: 1 1 220px; margin: 0; }
.tools select { width: auto; margin: 0; }
.emp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.emp { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: #fff; font: inherit; color: inherit; cursor: pointer; box-shadow: var(--shadow); }
.emp:hover { border-color: var(--gold); }
.emp .grow { flex: 1; min-width: 0; }
.emp b { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emp .sub { display: block; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emp .pay { text-align: right; font-weight: 700; font-size: 14px; white-space: nowrap; }
.emp .pay small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.emp-grid .empty { grid-column: 1 / -1; border: 1.5px dashed var(--line); border-radius: var(--r); background: #fff; }

/* team */
.team-list { display: grid; margin-top: 8px; }
.member { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 0; border-top: 1px solid var(--line-2); }
.member:first-child { border-top: 0; }
.member .grow { flex: 1; min-width: 160px; overflow-wrap: anywhere; font-size: 14px; }
.member select { width: auto; margin: 0; padding: 6px 10px; font-size: 13px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.inline-form input { flex: 1 1 200px; margin: 0; }
.inline-form select { flex: 1 1 200px; width: auto; margin: 0; }

/* switch */
.switch { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--gold-soft); border: 1px solid #f0d9a8; cursor: pointer; }
.switch input { appearance: none; -webkit-appearance: none; width: 42px; height: 24px; margin: 0; padding: 0; border-radius: 999px; border: 0; background: #d6c8b6; position: relative; flex: none; cursor: pointer; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.switch input:checked { background: var(--green); }
.switch input:checked::after { left: 21px; }
.switch span { font-size: 14px; }
.switch small { display: block; font-weight: 500; color: var(--muted); font-size: 12.5px; }

/* segmented status picker */
.seg { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 4px 0 14px; }
.seg label { margin: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 10px 4px; border-radius: 10px; border: 1.5px solid var(--line); font-size: 13px; cursor: pointer; }
.seg input:checked + span { border-color: var(--cocoa); background: var(--cocoa); color: #fff; }
.seg input:focus-visible + span { box-shadow: 0 0 0 3px rgba(201, 154, 78, .3); }
@media (max-width: 560px) { .seg { grid-template-columns: repeat(3, 1fr); } }

/* sheets */
.sheet { width: min(640px, 100%); max-height: 92vh; padding: 0; border: 0; border-radius: 20px; background: var(--paper); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.sheet.small-sheet { width: min(480px, 100%); }
.sheet::backdrop { background: rgba(33, 20, 12, .45); }
.sheet form { display: flex; flex-direction: column; max-height: 92vh; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { font-size: 18px; }
.sheet-body { padding: 8px 20px 12px; overflow-y: auto; }
.sheet-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); }
.x { border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); }
@media (max-width: 560px) {
  .sheet { max-height: 100vh; height: 100%; width: 100%; max-width: 100%; margin: 0; border-radius: 0; }
  .sheet form { max-height: 100vh; height: 100%; }
  .sheet.small-sheet { height: auto; margin: auto 0 0; border-radius: 20px 20px 0 0; }
  .sheet.small-sheet form { height: auto; }
  .sheet-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
}

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; background: var(--cocoa); color: #fff; padding: 11px 18px; border-radius: 14px; font-size: 14px; width: max-content; max-width: min(420px, 90vw); text-align: center; transition: .25s; pointer-events: none; z-index: 30; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 860px) { .toast { bottom: calc(86px + env(safe-area-inset-bottom)); } }

/* company details */
.lbl { font-size: 13px; font-weight: 600; color: #4a3a2e; margin: 0 0 6px; }
.days { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.days label { margin: 0; }
.days input { position: absolute; opacity: 0; pointer-events: none; }
.days span { display: block; min-width: 52px; text-align: center; padding: 8px 10px; border-radius: 10px; border: 1.5px solid var(--line); font-size: 13px; cursor: pointer; }
.days input:checked + span { background: var(--cocoa); border-color: var(--cocoa); color: #fff; }
.days input:disabled + span { cursor: default; }
.save-bar { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 35%); margin-bottom: 16px; }
@media (max-width: 860px) { .save-bar { bottom: calc(66px + env(safe-area-inset-bottom)); } }
.note-card.setup { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.note-card.setup b { display: block; }
.note-card.setup .bar { flex: none; width: 90px; height: 8px; border-radius: 99px; background: #f0d9a8; overflow: hidden; }
.note-card.setup .bar i { display: block; height: 100%; background: var(--gold); }
.note-card.setup .grow { flex: 1; min-width: 0; }
.note-card.setup .grow > span { display: block; }
input.up::placeholder { text-transform: none; }

/* leave & org chart */
.badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--red); color: #fff; font-size: 11.5px; display: inline-grid; place-items: center; }
.tabbar .badge { position: absolute; margin: 0; transform: translate(14px, -4px); }
.tabbar button { position: relative; }
.seg.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 560px) { .seg.four { grid-template-columns: repeat(2, 1fr); } }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.check input { width: 18px; height: 18px; margin: 0; }
.chip.casual, .chip.earned { background: var(--blue-bg); color: var(--blue); }
.chip.sick { background: var(--red-bg); color: var(--red); }
.chip.unpaid { background: var(--grey-bg); color: #6b5a4c; }
.chip.pending { background: var(--amber-bg); color: var(--amber); }
.chip.approved { background: var(--green-bg); color: var(--green); }
.chip.rejected, .chip.cancelled { background: var(--grey-bg); color: #8a7b6e; }
.person .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.person.mine { background: #fffaf0; margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 10px; }
.tag-team { font-size: 11px; font-weight: 700; color: #8a5a12; background: var(--gold-soft); border-radius: 6px; padding: 1px 6px; margin-left: 6px; }
.out-day { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 2px; }
.out-day:first-child { margin-top: 0; }
.seg-sm { display: inline-flex; background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg-sm button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 7px 12px; border-radius: 8px; font: 600 13px var(--f); color: var(--muted); cursor: pointer; }
.seg-sm button svg { width: 16px; height: 16px; }
.seg-sm button.is-on { background: var(--cocoa); color: #fff; }
.org { overflow-x: auto; padding: 6px 2px 20px; }
.org ul { list-style: none; margin: 0; padding: 0 0 0 28px; position: relative; }
.org > ul { padding-left: 0; }
.org li { position: relative; padding: 6px 0 6px 0; }
.org ul ul li::before { content: ""; position: absolute; left: -18px; top: 0; bottom: 0; border-left: 1.5px solid #e2d4bf; }
.org ul ul li:last-child::before { bottom: auto; height: 34px; }
.org ul ul li::after { content: ""; position: absolute; left: -18px; top: 34px; width: 16px; border-top: 1.5px solid #e2d4bf; }
.node { display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px 10px 10px; border-radius: 14px; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); min-width: 230px; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.node:hover { border-color: var(--gold); }
.node b { display: block; font-size: 14px; }
.node small { color: var(--muted); font-size: 12px; }
.node .cnt { margin-left: auto; font-size: 11.5px; font-weight: 700; color: #8a5a12; background: var(--gold-soft); border-radius: 99px; padding: 2px 8px; }
.depts { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.dept-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.dept-card h2 { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.dept-card h2 small { font-size: 12px; color: var(--muted); font-weight: 600; }
.stack { display: flex; }
.stack .avatar { margin-left: -8px; border: 2px solid #fff; }
.stack .avatar:first-child { margin-left: 0; }
.grid2 > * { min-width: 0; }
.person b:has(.tag-team) { white-space: normal; }
.tabbar { grid-auto-flow: column; grid-auto-columns: 1fr; grid-template-columns: none !important; }
@media (max-width: 560px) {
  .person { flex-wrap: wrap; }
  .person .acts { width: 100%; justify-content: flex-start; padding-left: 46px; margin-top: -4px; }
}

/* self-service profile */
.bank-box { border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px; margin: 14px 0 6px; }
.bank-box[open] { padding-bottom: 12px; }
.bank-box summary { cursor: pointer; font-weight: 700; padding: 10px 0; }
.bank-box summary small { font-weight: 500; color: var(--muted); margin-left: 6px; }
.emp-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -2px 0 14px; font-size: 13.5px; }
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 14px; }
.steps button { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 6px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font: 600 13px var(--f); color: var(--muted); cursor: pointer; }
.steps button b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--grey-bg); font-size: 12px; color: #5d4d40; }
.steps button.is-on { border-color: var(--cocoa); color: var(--ink); }
.steps button.is-on b { background: var(--cocoa); color: #fff; }
.steps button.ok b { background: var(--green); color: #fff; }
@media (max-width: 560px) { .steps button { flex-direction: column; gap: 4px; font-size: 11.5px; } }
.prof-foot { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 6px; }
.prof-foot #profPrev { margin-right: auto; }
.prof-status { border-radius: var(--r); padding: 14px 16px; margin-bottom: 14px; border: 1px solid var(--line); background: #fff; }
.prof-status b { display: block; font-size: 15px; }
.prof-status.draft { background: var(--gold-soft); border-color: #f0d9a8; }
.prof-status.submitted { background: var(--blue-bg); border-color: #c9d8f5; }
.prof-status.approved { background: var(--green-bg); border-color: #bfe3cc; }
.prof-status.returned { background: var(--red-bg); border-color: #f2c4bd; }
.bank-found { margin: -6px 0 12px; font-size: 13px; color: var(--green); font-weight: 600; }
.bank-found.bad { color: var(--red); }
.sum { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; margin-bottom: 14px; }
@media (max-width: 560px) { .sum { grid-template-columns: 1fr; } }
.sum h4 { grid-column: 1 / -1; margin: 6px 0 0; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.sum div small { display: block; color: var(--muted); font-size: 12px; }
.sum div b { font-size: 14px; overflow-wrap: anywhere; }
.sum div.changed b { background: #fff1c2; border-radius: 4px; padding: 0 4px; }
.sum div.changed small::after { content: " · changed"; color: var(--amber); font-weight: 700; }
.alert-line { background: var(--amber-bg); color: #7a4f12; border-radius: 10px; padding: 10px 12px; font-size: 13.5px; margin-bottom: 12px; }

/* photos and profile card */
.avatar.photo { background-size: cover !important; background-position: center !important; color: transparent; }
.prof-card { position: relative; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; padding: 22px; border-radius: 20px; margin-bottom: 14px; color: #fff;
  background: radial-gradient(120% 120% at 0% 0%, #5a3a24 0%, var(--cocoa) 70%); box-shadow: var(--shadow); }
.prof-card .pic { position: relative; flex: none; }
.prof-card .pic .avatar { width: 96px; height: 96px; font-size: 30px; border: 3px solid rgba(255, 255, 255, .85); }
.prof-card .pic button { position: absolute; right: -4px; bottom: -4px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--gold-2); color: var(--cocoa); cursor: pointer; display: grid; place-items: center; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.prof-card .pic button svg { width: 17px; height: 17px; }
.prof-card .who { flex: 1; min-width: 200px; }
.prof-card h2 { font-size: 22px; margin: 0 0 2px; letter-spacing: -.01em; }
.prof-card .role { color: var(--gold-2); font-weight: 600; margin: 0 0 10px; }
.prof-card .facts { display: flex; flex-wrap: wrap; gap: 6px; }
.prof-card .facts span { font-size: 12.5px; background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .12); border-radius: 99px; padding: 4px 10px; color: #f1e6d6; }
.prof-card .kpis { display: grid; grid-template-columns: repeat(3, minmax(84px, 1fr)); gap: 8px; width: 100%; margin-top: 4px; }
.prof-card .kpis div { background: rgba(255, 255, 255, .07); border-radius: 12px; padding: 10px 12px; }
.prof-card .kpis b { display: block; font-size: 20px; }
.prof-card .kpis small { color: #bca78f; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; }
.prof-card.mini { padding: 16px; border-radius: 16px; margin: 6px 0 14px; }
.prof-card.mini .pic .avatar { width: 72px; height: 72px; font-size: 24px; }
.prof-card.mini h2 { font-size: 18px; }
.prof-card .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.prof-card .acts .btn { background: rgba(255, 255, 255, .1); color: #fff; border: 1px solid rgba(255, 255, 255, .2); }
@media (min-width: 861px) { .prof-card:not(.mini) .kpis { width: auto; flex: 0 0 340px; margin-top: 0; } }

.rows { display: grid; gap: 10px; margin-bottom: 10px; }
.row-item { position: relative; display: grid; grid-template-columns: 1.2fr 1fr .8fr .8fr; gap: 0 10px; padding: 12px 40px 0 12px; border: 1px solid var(--line); border-radius: 12px; background: #fffdf9; }
.row-item.edu { grid-template-columns: 1fr 1.2fr .6fr; }
.row-item label { margin-bottom: 12px; }
.row-item .rm { position: absolute; top: 8px; right: 8px; border: 0; background: none; font-size: 20px; color: var(--muted); cursor: pointer; }
@media (max-width: 560px) { .row-item, .row-item.edu { grid-template-columns: 1fr 1fr; } .row-item label:first-of-type { grid-column: 1 / -1; } }
.sum .wide { grid-column: 1 / -1; }
.row-item > *, .row-item input { min-width: 0; }
.row-item input[type=month] { width: 100%; }

/* probation and offer letters */
.prob-note { align-self: center; margin: 6px 0 12px; }
textarea { display: block; width: 100%; margin-top: 5px; font: 15px var(--f); padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; resize: vertical; }
.offer-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-top: 10px; }
.offer { text-align: left; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); font: inherit; color: inherit; cursor: pointer; display: grid; gap: 6px; }
.offer:hover { border-color: var(--gold); }
.offer b { font-size: 15px; }
.offer small { color: var(--muted); }
.offer .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.chip.draft { background: var(--grey-bg); color: #6b5a4c; }
.chip.sent { background: var(--blue-bg); color: var(--blue); }
.chip.accepted { background: var(--green-bg); color: var(--green); }
.chip.declined { background: var(--red-bg); color: var(--red); }
.letter-sheet { width: min(760px, 100%); }
.letter-sheet .sheet-inner { display: flex; flex-direction: column; max-height: 92vh; }
.letter-body { background: #f6efe4; padding: 0; }
.letter-body > div > div { padding: 14px 8px !important; }
.letter-foot { flex-wrap: wrap; justify-content: flex-start; align-items: center; }
.letter-foot .chip { margin-right: auto; }
@media (max-width: 560px) { .letter-sheet .sheet-inner { max-height: 100vh; height: 100%; } }
.prob-chip { background: var(--amber-bg); color: #7a4f12; }
.letter-foot .chip { flex-basis: 100%; margin: 0 0 4px; justify-content: flex-start; width: max-content; max-width: 100%; }
.letter-foot #letterMail, .letter-foot #letterHire { margin-left: auto; }

/* HR help desk */
.q-list { display: grid; }
.q-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 18px; border: 0; border-top: 1px solid var(--line-2); background: #fff; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.q-row:first-child { border-top: 0; }
.q-row:hover { background: #fffcf6; }
.q-row .grow { flex: 1; min-width: 0; }
.q-row b { display: block; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-row small { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-row .when { font-size: 12px; color: var(--muted); white-space: nowrap; text-align: right; }
.q-row.unread b::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--red); margin-right: 6px; vertical-align: middle; }
.chip.open { background: var(--amber-bg); color: var(--amber); }
.chip.answered { background: var(--blue-bg); color: var(--blue); }
.chip.closed { background: var(--grey-bg); color: #8a7b6e; }
.q-cats { grid-template-columns: repeat(2, 1fr) !important; }
.q-cats label:last-child { grid-column: 1 / -1; }
.q-inner { display: flex; flex-direction: column; max-height: 92vh; }
.q-inner .sheet-head { align-items: flex-start; }
.q-inner .sheet-head p { margin: 2px 0 0; }
.q-msgs { display: flex; flex-direction: column; gap: 10px; padding: 12px 0; }
.q-msg { max-width: 82%; padding: 10px 14px; border-radius: 16px; font-size: 14.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.q-msg small { display: block; font-size: 11.5px; opacity: .7; margin-top: 4px; white-space: normal; }
.q-msg.them { background: var(--grey-bg); align-self: flex-start; border-bottom-left-radius: 4px; }
.q-msg.me { background: var(--cocoa); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.q-msg.sys { align-self: center; background: none; color: var(--muted); font-size: 12.5px; padding: 2px; }
.q-reply { border-top: 1px solid var(--line); padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); }
.q-reply textarea { margin: 0 0 8px; }
.q-acts { display: flex; gap: 8px; justify-content: flex-end; }
.q-quick { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.q-quick button { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 5px 10px; font: 600 12px var(--f); color: #5d4d40; cursor: pointer; }
.q-quick button:hover { border-color: var(--gold); }
@media (max-width: 560px) { .q-inner { max-height: 100vh; height: 100%; } }

/* holidays and leave balances */
.row-item.hol { grid-template-columns: .8fr 1.6fr auto; align-items: end; }
.row-item.hol .check { margin-bottom: 14px; white-space: nowrap; }
@media (max-width: 560px) { .row-item.hol { grid-template-columns: 1fr 1fr; } }
.bal-table { overflow-x: auto; }
.bal-table table { width: 100%; border-collapse: collapse; font-size: 14px; }
.bal-table th, .bal-table td { padding: 10px 12px; border-top: 1px solid var(--line-2); text-align: left; white-space: nowrap; }
.bal-table th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; border-top: 0; }
.bal-table td .avatar { margin-right: 8px; vertical-align: middle; }
.bal-table td.n b { font-size: 15px; }
.bal-table td.n small { color: var(--muted); }
.bal-table td.low b { color: var(--red); }
.bal-line { background: var(--gold-soft); border-radius: 10px; padding: 8px 12px; font-size: 13.5px; margin: 0 0 8px; }
.bal-line.warn { background: var(--amber-bg); color: #7a4f12; }
.chip.holiday { background: #f3e8ff; color: #7c3aed; }
.mini-stats.bal div b small { font-size: 13px; color: var(--muted); font-weight: 600; }
