/* Mi Sithech. Phone first: tabs along the bottom; on a wide screen they move to the left. */
:root {
  --night: #1B2350; --night-2: #2B3678; --sun: #F2B33D; --teal: #2E6B66; --teal-soft: #E6F1EF;
  --bg: #F4F5F8; --card: #FFFFFF; --ink: #1B1D24; --muted: #5F6370; --line: #E2E4EA; --error: #B3261E; --good: #2E6B66;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0F1430; --card: #182048; --ink: #E9ECF5; --muted: #A5ABC0; --line: #2A3360; --teal-soft: #173A37; --error: #FFB4AB; --good: #7FD1C4; color-scheme: dark; }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 16px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
h1 { font-size: 30px; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 20px; margin: 0; }
a { color: inherit; }
[hidden] { display: none !important; }

.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 12px; }
.between { justify-content: space-between; }
.center { text-align: center; }
.narrow { width: 100%; max-width: 420px; margin: 0 auto; }
.small { font-size: 14px; color: var(--muted); }
.muted { color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }

/* Dark welcome screens */
main.dark { min-height: 100%; background: linear-gradient(160deg, var(--night-2), var(--night)); color: #fff;
  padding: max(32px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); }
main.dark .small { color: rgba(255,255,255,.75); }
main.dark input, main.dark select { background-color: rgba(255,255,255,.08); border-color: rgba(255,255,255,.28); color: #fff; }
main.dark .link { color: var(--sun); }
main.light { min-height: 100%; padding: max(28px, env(safe-area-inset-top)) 20px 32px; }
.center { display: block; }
main.center { display: flex; align-items: center; text-align: left; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; margin-bottom: 8px; }
.small-brand { flex-direction: row; justify-content: center; }
.logo { border-radius: 22%; display: block; }
.tagline { margin: 0; color: var(--sun); font-weight: 600; }
.notice { display: flex; gap: 8px; align-items: center; background: rgba(255,255,255,.08); padding: 12px; border-radius: 12px; color: var(--sun); font-weight: 600; margin: 0; }
.or { text-align: center; opacity: .7; font-size: 14px; }
.splash { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: var(--night); color: #fff; }

/* Fields and buttons: at least 44px to tap */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; }
input, select { width: 100%; min-height: 48px; height: 48px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background-color: var(--card); }
/* Drop-downs are exactly the same box as a text field. Safari won't let a native
   menulist take our height, so we turn the native look off and draw the arrow ourselves. */
select { -webkit-appearance: none; appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%235F6370' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 12px 8px; }
@media (prefers-color-scheme: dark) { select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23A5ABC0' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); } }
main.dark select, header.top select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23ffffff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
select::-ms-expand { display: none; }
input.code { height: auto; min-height: 56px; }
input[type=checkbox], input[type=file] { height: auto; }
input.code { text-transform: uppercase; letter-spacing: .12em; font-size: 20px; text-align: center; }
input:focus-visible, select:focus-visible, button:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
button { min-height: 48px; border-radius: 12px; border: 0; padding: 0 18px; font-weight: 600; cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
.primary { background: var(--teal); color: #fff; }
.secondary { background: transparent; border: 1px solid var(--line); }
main.dark .secondary { border-color: rgba(255,255,255,.4); color: #fff; }
.google { background: #fff; color: #1f1f1f; display: flex; align-items: center; justify-content: center; gap: 10px; }
.google .g { color: #4285F4; font-weight: 800; font-size: 19px; }
.link { background: none; min-height: 44px; padding: 0; color: var(--teal); font-weight: 600; }
.msg { margin: 0; min-height: 1.2em; font-size: 15px; }
.msg.error { color: var(--error); }
main.dark .msg.error { color: #FFB4AB; }
.msg.good { color: var(--good); }
main.dark .msg.good { color: var(--sun); }
.lang { max-width: 220px; margin: 0 auto; }

/* Signed-in shell */
.shell { min-height: 100%; display: grid; grid-template-rows: auto 1fr auto; }
header.top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; background: var(--night); color: #fff;
  padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); }
header.top .who { display: flex; flex-direction: column; flex: 1; min-width: 0; }
header.top .who strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
header.top .small { color: rgba(255,255,255,.75); }
header.top select { width: auto; background-color: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.3); max-width: 45%; }
.content { padding: 20px max(16px, env(safe-area-inset-right)) 24px max(16px, env(safe-area-inset-left)); max-width: 760px; width: 100%; margin: 0 auto; }
nav.tabs { position: sticky; bottom: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); }
.tab { background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; font-weight: 600; color: var(--muted); min-height: 58px; border-radius: 0; padding: 6px 2px; }
.tab.on { color: var(--teal); }
@media (prefers-color-scheme: dark) { .tab.on { color: var(--sun); } }

@media (min-width: 900px) {
  .shell { grid-template-columns: 220px 1fr; grid-template-rows: auto 1fr; }
  header.top { grid-column: 1 / -1; }
  nav.tabs { grid-row: 2; grid-column: 1; position: sticky; top: 64px; align-self: start; grid-auto-flow: row; border-top: 0; border-right: 1px solid var(--line); height: calc(100vh - 64px); align-content: start; padding: 12px 0; }
  .tab { flex-direction: row; justify-content: flex-start; gap: 12px; font-size: 15px; padding: 0 20px; min-height: 48px; }
  .content { grid-row: 2; grid-column: 2; }
}

/* Home and payslip lists */
.grow { flex: 1; min-width: 0; }
.stack-s { display: flex; flex-direction: column; gap: 8px; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 4px 4px 0; }
h2.hello { font-size: 22px; }
.amt, .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.amt.big { font-size: 20px; font-weight: 800; }
.teal { color: var(--teal); }
@media (prefers-color-scheme: dark) { .teal { color: var(--good); } }
button.card, button.li { width: 100%; text-align: left; font-weight: 400; }
.rowbtn { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.card.list { padding: 0 16px; }
.li { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 0; border-radius: 0; background: none; }
.li + .li { border-top: 1px solid var(--line); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.chev { color: var(--muted); font-size: 22px; line-height: 1; }
.badge { display: inline-flex; align-items: center; justify-content: center; background: #fff; border-radius: 10px; padding: 3px; border: 1px solid rgba(0,0,0,.08); flex: none; }
.badge img { display: block; max-width: 120px; object-fit: contain; }
.badge.initials { background: var(--night); color: var(--sun); font-weight: 700; border-radius: 50%; padding: 0; }
body.away .amt, body.away .slip { filter: blur(10px); }

/* The payslip: always light, like paper */
.slip { --ink: #111114; --muted: #5c5c62; background: #fff; color: #111114; border-radius: 14px; overflow: hidden; font-size: 13px; line-height: 1.35;
  box-shadow: 0 1px 3px rgba(0,0,0,.08); color-scheme: light; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.slip small { font-size: 10.5px; color: #5c5c62; }
.slip .hd { display: flex; gap: 10px; align-items: flex-start; background: #1b2350; color: #fff; padding: 14px; }
.slip .en { font-size: 17px; font-weight: 800; }
.slip .ea { font-size: 11px; color: rgba(255,255,255,.75); }
.slip .rt { text-align: right; }
.slip .ti { font-weight: 800; color: #f4b23e; font-size: 14px; }
.slip .emp { background: #f5f7fb; padding: 10px 16px; }
.slip .nmb { font-size: 17px; font-weight: 800; margin-bottom: 6px; }
.slip .fds { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.slip .fd { display: flex; flex-direction: column; }
.slip .fd b { font-size: 12.5px; }
.slip .pad, .slip .sec { padding: 0 16px; }
.slip .sh { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; font-size: 11.5px; padding: 10px 0 4px; border-bottom: 2px solid #1b2350; }
.slip .sh span:last-child { font-weight: 400; color: #5c5c62; font-size: 10.5px; text-align: right; }
.slip .ln { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 5px 0; border-bottom: .5px solid #e5e5ea; }
.slip .ln .nm { flex: 1; }
.slip .ln .nm small { display: block; font-size: 9px; }
.slip .ln.tot { font-weight: 700; border-bottom: 0; }
.slip .note { flex: none; align-self: center; }
.slip .net { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: #0b6b6a; color: #fff; border-radius: 10px; margin: 6px 12px 0; padding: 8px 12px; }
.slip .net small { display: block; color: rgba(255,255,255,.85); font-size: 10px; }
.slip .ctc { display: flex; justify-content: space-between; align-items: center; background: #eef0f7; border-radius: 10px; padding: 7px 10px; margin-top: 6px; }
.slip .ctc small { display: block; }
.slip .ctc .amt { font-weight: 800; font-size: 15px; }
.slip table.lv { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.slip .lv th { font-size: 10.5px; text-align: right; padding: 10px 0 4px 6px; border-bottom: 2px solid #1b2350; vertical-align: bottom; }
.slip .lv th:first-child, .slip .lv td:first-child { text-align: left; padding-left: 0; }
.slip .lv td { text-align: right; padding: 5px 0 5px 6px; border-bottom: .5px solid #e5e5ea; }
.slip .lv td.b { font-weight: 600; }
.slip .lv tr.adj td { text-align: left; font-size: 10.5px; color: #5c5c62; }
.slip .msgb { background: #fdf0d5; border-radius: 8px; padding: 9px; margin: 10px 16px 0; }
.slip .msgb small { font-weight: 700; display: block; }
.slip .ycols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding-top: 6px; font-size: 11px; }
@media (max-width: 520px) { .slip .ycols { grid-template-columns: 1fr; } }
.slip .yl { display: flex; justify-content: space-between; gap: 4px; padding: 1.5px 0; }
.slip .yl small { font-size: 8.5px; }
.slip .yt { font-weight: 700; border-top: .5px solid #d1d1d6; margin-top: 2px; }
.slip .ysum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; background: #eef0f7; border-radius: 8px; padding: 6px 9px; margin-top: 6px; }
.slip .ysum div { display: flex; flex-direction: column; }
.slip .ysum .b { font-weight: 800; }
.slip .muted { color: #5c5c62; }
.slip .tn { font-size: 10.5px; color: #5c5c62; padding: 6px 16px 0; margin: 0; }
.slip .ft { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 9.5px; color: #5c5c62; margin: 12px 16px 0; padding: 6px 0 12px; border-top: .5px solid #d9dbe5; }

/* Printing / saving as PDF: only the payslip, on A4 */
@media print {
  @page { size: A4; margin: 12mm; }
  html, body { background: #fff !important; height: auto; }
  header.top, nav.tabs, .noprint { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  .slip { box-shadow: none; border-radius: 0; font-size: 12px; }
  body.away .slip { filter: none; }
}
#app { min-height: 100%; }
.shell { min-height: 100vh; min-height: 100dvh; }
.slip .pad .sec { padding: 0; }

/* Leave */
h3.typeh { display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-size: 16px; color: var(--ink); }
.foot { margin: 0 4px; }
.li.col { flex-direction: column; align-items: stretch; gap: 3px; padding: 12px 0; }
.li.col > .link { align-self: flex-start; min-height: 36px; }
.status { font-size: 13px; font-weight: 700; color: var(--muted); }
.status.pending { color: #B26A00; } .status.approved { color: var(--teal); } .status.declined { color: var(--error); }
@media (prefers-color-scheme: dark) { .status.pending { color: var(--sun); } .status.approved { color: var(--good); } }
.link.danger { color: var(--error); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 360px) { .two { grid-template-columns: 1fr; } }
.card.inset { background: var(--bg); }
.li.warn, .li.warn .num { color: #B26A00; }
textarea { width: 100%; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font: inherit; color: inherit; resize: vertical; }
input[type=date] { -webkit-appearance: none; appearance: none; }

/* Leave calendar */
.cal { display: flex; flex-direction: column; gap: 8px; }
.navb { font-size: 26px; width: 44px; justify-content: center; color: var(--ink); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-h { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding: 2px 0; }
.cal-d { position: relative; min-height: 42px; padding: 0; border-radius: 10px; background: transparent; font-weight: 500; font-variant-numeric: tabular-nums; }
.cal-d.we { background: var(--line); color: var(--muted); }
.cal-d.ph { background: #FCE9C2; color: #7A4B00; font-weight: 700; }
.cal-d .phdot { position: absolute; top: 4px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: #D9822B; }
.cal-d.today { box-shadow: inset 0 0 0 2px var(--muted); }
.cal-d.sel { background: var(--teal-soft); color: var(--ink); box-shadow: inset 0 0 0 2px var(--teal); }
.cal-d.sel.we, .cal-d.sel.ph { background: repeating-linear-gradient(135deg, var(--teal-soft) 0 5px, var(--line) 5px 8px); }
.cal-d.first, .cal-d.last { background: var(--teal); color: #fff; box-shadow: none; }
.cal-d.first.ph, .cal-d.last.ph, .cal-d.first.we, .cal-d.last.we { background: var(--teal); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; }
.sw.we { background: var(--line); } .sw.ph { background: #FCE9C2; border: 1px solid #D9822B; } .sw.sel { background: var(--teal); }
.chosen { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.chosen div { display: flex; flex-direction: column; background: var(--bg); border-radius: 12px; padding: 8px 12px; }
.chosen small { color: var(--muted); font-size: 12px; }
.li.hols { color: var(--muted); }
.li.total { border-top: 2px solid var(--line); }
.num.big { font-size: 22px; font-weight: 800; color: var(--teal); }
@media (prefers-color-scheme: dark) {
  .cal-d.ph { background: #4A3A12; color: #FFD98A; }
  .sw.ph { background: #4A3A12; }
  .num.big { color: var(--good); }
}

/* Claims */
.row.wrap { flex-wrap: wrap; }
h3.plain { text-transform: none; letter-spacing: 0; font-size: 16px; color: var(--ink); margin: 0; }
a.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; border-radius: 12px; padding: 0 18px; font-weight: 600; text-decoration: none; }
a.button.secondary { border: 1px solid var(--line); }
.receipt-preview img { display: block; max-width: 100%; max-height: 260px; margin: 0 auto; border-radius: 10px; border: 1px solid var(--line); }
.receipt-preview:empty { display: none; }
.pdfchip { display: inline-flex; align-items: center; gap: 8px; color: var(--teal); font-weight: 600; }
.receipt-img { max-width: 100%; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
input.amount { text-align: right; font-variant-numeric: tabular-nums; font-size: 18px; }
.status.cancelled { color: var(--muted); }

/* Travel by km */
.segs { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); border-radius: 12px; padding: 3px; gap: 3px; }
.seg { min-height: 40px; background: transparent; color: var(--muted); border-radius: 10px; }
.seg.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.trip { display: flex; flex-direction: column; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.trip > .link { align-self: flex-start; min-height: 36px; }

/* My details */
.li .val { text-align: right; max-width: 62%; overflow-wrap: anywhere; }
.small.b { font-weight: 700; color: var(--ink); }

/* Team */
.tab { position: relative; }
.tab[data-count]::after { content: attr(data-count); position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--error); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
@media (min-width: 900px) { .tab[data-count]::after { position: static; margin-left: auto; } }
.small-btn { min-height: 40px; padding: 0 14px; display: inline-flex; align-items: center; gap: 4px; }
.danger-text { color: var(--error); }
.danger-bg { background: var(--error); }
.warn-text { color: #B26A00; }
@media (prefers-color-scheme: dark) { .warn-text { color: var(--sun); } }
.decide { background: var(--bg); border-radius: 12px; padding: 10px; }

/* Install help (step 8): how to put the app on the home screen */
.install .logo { flex: none; }
.install .wrap { flex-wrap: wrap; }
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.steps li { padding-left: 2px; }
.key { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 24px; margin: 0 2px; vertical-align: -6px;
  border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--teal); }
.key svg { stroke-width: 2.4; }
.install.welcome { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: #fff; }
.install.welcome .key { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.3); color: var(--sun); }
@media (prefers-color-scheme: dark) { .key { color: var(--sun); } }
.install { display: flex; flex-direction: column; gap: 12px; }
.install p { margin: 0; }
.install p .link { min-height: 0; display: inline; }

/* Fingerprint and face sign-in */
p.good { margin: 0; color: var(--good); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.li .tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--teal-soft); color: var(--teal); margin-left: 8px; vertical-align: 2px; }

/* A notification that arrives while the app is open */
button.toast { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; background: var(--night); color: #fff;
  border-radius: 14px; padding: 12px 16px; margin-bottom: 14px; font-weight: 400; }
button.toast .small { color: rgba(255,255,255,.75); }

/* Drop-downs are the same size as the text boxes: one rule for both (input, select above). */
.row.wrap > .field { flex: 1 1 200px; }
.field select, .field input { width: 100%; }
label.check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
label.check input { width: 22px; height: 22px; min-height: 0; height: 22px; accent-color: var(--teal); flex: none; }
.good-card { border-color: var(--teal); }

/* My photo on the Me page (the same round picture payroll sees). */
.avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex: none; background: var(--line); }
.avatar.none { display: flex; align-items: center; justify-content: center; background: var(--night); color: var(--sun); font-weight: 700; font-size: 26px; }
#my-photo { gap: 14px; align-items: center; }
