/* ZoiHR web app. One stylesheet, no framework. Brand colour can be overridden per
   company on the employee side via --brand (set from the company's white-label colour). */
:root {
  --ink: #22232e; --muted: #666b78; --line: #e3e5ea; --bg: #f5f6f8; --card: #fff;
  --brand: #ec7a2c; --brand-ink: #fff; --ok: #1d7a46; --ok-bg: #e6f4ec;
  --warn: #9a5b00; --warn-bg: #fff3dc; --bad: #b3261e; --bad-bg: #fdecea; --info-bg: #eef1f6;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
       color: var(--ink); background: var(--bg); }
h1 { font-size: 1.5rem; line-height: 1.2; margin: 0 0 .5rem; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
h3 { font-size: 1rem; margin: 0 0 .5rem; }
p { margin: 0 0 .75rem; }
a { color: inherit; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; word-break: break-all; }

.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-in { max-width: 1100px; margin: 0 auto; padding: .65rem 1rem; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.brand { font-weight: 800; letter-spacing: .04em; font-size: 1.15rem; text-decoration: none; display: flex; align-items: center; gap: .5rem; }
.brand b { color: var(--brand); }
.brand img { height: 28px; width: auto; }
.brand .sub { font-weight: 500; letter-spacing: 0; color: var(--muted); font-size: .9rem; }
.spacer { flex: 1; }
main { max-width: 1100px; margin: 0 auto; padding: 1.25rem 1rem 4rem; }
main.narrow { max-width: 560px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; margin-bottom: 1rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: .75rem; }

label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .25rem; }
input, select, textarea { width: 100%; font: inherit; color: inherit; padding: .6rem .7rem; border: 1px solid #c9cdd6;
  border-radius: 8px; background: #fff; min-height: 44px; }
textarea { min-height: 110px; font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }
input[type=checkbox] { width: 20px; height: 20px; min-height: 0; padding: 0; vertical-align: middle; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 55%, white); outline-offset: 2px; }
.field { margin-bottom: .75rem; }
.inline { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.inline input { flex: none; }

button, .btn { font: inherit; font-weight: 650; border-radius: 8px; border: 1px solid #c9cdd6; background: #fff; color: var(--ink);
  padding: .55rem .95rem; min-height: 44px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: .4rem; }
button.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
button.danger { color: var(--bad); border-color: #e6b4b0; }
button.link { border: 0; background: none; padding: .25rem .1rem; min-height: 0; text-decoration: underline; font-weight: 500; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.big { width: 100%; justify-content: center; font-size: 1.05rem; padding: .85rem 1rem; }

.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; overflow-x: auto; }
.tabs a { padding: .6rem .9rem; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a[aria-current=page] { color: var(--ink); border-bottom-color: var(--brand); }

.msg { border-radius: 8px; padding: .65rem .8rem; margin-bottom: .75rem; }
.msg.err { background: var(--bad-bg); color: var(--bad); }
.msg.ok { background: var(--ok-bg); color: var(--ok); }
.msg.info { background: var(--info-bg); }
.msg.warn { background: var(--warn-bg); color: var(--warn); }

.chip { display: inline-block; border-radius: 999px; padding: .1rem .6rem; font-size: .8rem; font-weight: 650; white-space: nowrap; }
.chip.ready, .chip.published, .chip.active, .chip.review { background: var(--ok-bg); color: var(--ok); }
.chip.needs_review, .chip.processing, .chip.uploaded { background: var(--warn-bg); color: var(--warn); }
.chip.failed, .chip.revoked, .chip.ended { background: var(--bad-bg); color: var(--bad); }
.chip.published { background: #e3ecfb; color: #1c4fa3; }
.reasons { margin: .25rem 0 0; padding-left: 1.1rem; color: var(--warn); font-size: .875rem; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: .4rem .5rem; border-bottom: 1px solid var(--line); }
td { padding: .6rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.tablewrap { overflow-x: auto; }
td .row { gap: .4rem; }
td input, td select { min-height: 38px; padding: .35rem .5rem; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: .75rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.hero { text-align: center; padding: 1.5rem 0 .5rem; }

dialog { border: 0; border-radius: var(--radius); padding: 1.25rem; width: min(520px, calc(100vw - 2rem)); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(20, 22, 30, .45); }

@media (max-width: 720px) {
  .grid2 { grid-template-columns: 1fr; }
  /* Tables turn into stacked cards so nothing needs sideways scrolling on a phone. */
  table.resp thead { display: none; }
  table.resp tr { display: block; border: 1px solid var(--line); border-radius: 10px; margin-bottom: .75rem; padding: .35rem .6rem; background: #fff; }
  table.resp td { display: flex; gap: .75rem; border: 0; padding: .35rem 0; }
  table.resp td::before { content: attr(data-label); flex: 0 0 38%; color: var(--muted); font-size: .8rem; font-weight: 650; }
  table.resp td > * { flex: 1; min-width: 0; }
}

/* Phone header: keep brand, language and sign-out on one row. */
.brand { min-width: 0; }
.brand > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 720px) {
  .top-in { flex-wrap: nowrap; gap: .4rem; padding: .5rem .75rem; }
  .top-in .brand { flex: 1; font-size: 1rem; }
  .top-in .brand .sub { display: none; }
  .top-in .spacer { display: none; }
  .top-in select, .top-in button { min-height: 40px; padding: .35rem .6rem; font-size: .9rem; }
}

/* Working time */
.strike { text-decoration: line-through; color: var(--muted); }
.tabs.sub a { font-size: .9rem; padding: .45rem .75rem; }
.card .row .field { margin-bottom: 0; }
[hidden] { display: none !important; }

/* Leave and requests (delivery 4) */
.quote { border-left: 3px solid var(--line); padding: .25rem .6rem; margin: .35rem 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.timeline { color: inherit; list-style: none; padding-left: 0; }
.timeline li { padding: .3rem 0; border-bottom: 1px dashed var(--line); }
.list.cases li { align-items: flex-start; }
.list.cases .detail:not(:empty) { margin-top: .6rem; padding: .75rem; background: var(--info-bg); border-radius: 8px; }
.list.cases input[type=text] { margin: .4rem 0; }
h3 { font-size: .95rem; margin: .6rem 0 .25rem; }

/* expenses */
.totals { margin-top: .75rem; }
.totals td { padding: .35rem .25rem; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.strong { font-weight: 700; }
.good { color: var(--ok); }
.bad { color: var(--bad); }
img.receipt { display: block; max-width: 100%; max-height: 70vh; margin: .5rem auto; border: 1px solid var(--line); border-radius: 8px; }
.msg.small { padding: .35rem .6rem; margin: .3rem 0; }
[hidden] { display: none !important; }
.detail.stack { margin-top: .5rem; }

/* operations */
img.qr { display: block; width: 200px; height: 200px; margin: .5rem 0; background: #fff; border: 1px solid var(--line); border-radius: 8px; }

.brand-preview { display: flex; align-items: center; gap: .6rem; margin: .75rem 0; padding: .6rem .8rem; border: 2px solid var(--line); border-radius: 8px; background: #fff; }
.brand-preview img { max-height: 32px; max-width: 120px; }
.brand-preview .chip { margin-left: auto; color: #fff; padding: .15rem .5rem; border-radius: 999px; font-size: .8rem; }
input[type=color] { width: 3rem; height: 2.2rem; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
