/* salary-slip.css — the Salary Slip Maker (/salary-slip/, its pages and /salary-slip/view/).
   The pages are generated: see scripts/build-salary-slip.js. */
:root{ --cream:#faf5ec; --paper:#fffdf8; --ink:#221a12; --inksoft:#6f6152; --maroon:#0e386d; --gold:#0b7d74; --golddeep:#0a5f57; --line:#e8ddc9; --radius:16px; --ok:#2fa35f; --okdeep:#1f7d46; --bad:#c0392b; }
*{ box-sizing:border-box; margin:0; padding:0; -webkit-tap-highlight-color:transparent; }
html,body{ height:100%; }
html{ scroll-behavior:smooth; scroll-padding-top:12px; }
[hidden]{ display:none !important; }
body{ font-family:"Hanken Grotesk",system-ui,sans-serif; background:var(--cream); color:var(--ink); line-height:1.5; display:flex; flex-direction:column; min-height:100%; }
header.site{ display:flex; align-items:center; justify-content:space-between; padding:14px 18px; border-bottom:1.5px solid var(--line); background:var(--paper); }
header.site .brand{ font-family:"Fraunces",Georgia,serif; font-weight:900; font-size:20px; letter-spacing:-.02em; color:var(--maroon); text-decoration:none; }
header.site .brand img{ width:24px; height:24px; margin-right:8px; vertical-align:-6px; display:inline-block; }
header.site .brand span{ color:var(--gold); }
header.site .back{ font-size:13px; font-weight:700; color:var(--maroon); text-decoration:none; }
main{ width:100%; max-width:1100px; margin:0 auto; padding:26px 16px calc(40px + env(safe-area-inset-bottom)); }
h1.title{ font-family:"Fraunces",Georgia,serif; font-weight:900; font-size:30px; line-height:1.15; text-align:center; margin:4px 0 4px; }
.sub{ text-align:center; color:var(--inksoft); font-size:15px; margin-bottom:20px; }
.panel{ background:var(--paper); border:1.5px solid var(--line); border-radius:var(--radius); padding:18px; margin-bottom:18px; box-shadow:0 8px 24px -18px rgba(34,26,18,.5); }
.step-label{ font-size:12px; font-weight:800; letter-spacing:.14em; text-transform:uppercase; color:var(--golddeep); margin:0 0 10px; display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; }
.step-label.gap{ margin-top:22px; padding-top:16px; border-top:1.5px solid var(--line); }
.step-label .cnt{ font-weight:700; color:var(--inksoft); letter-spacing:0; text-transform:none; text-align:right; }
input,select,textarea{ font:inherit; font-size:15px; padding:10px 11px; border:1.5px solid var(--line); border-radius:10px; background:#fff; color:var(--ink); width:100%; min-width:0; }
input:focus,select:focus,textarea:focus{ outline:none; border-color:var(--gold); }
textarea{ resize:vertical; min-height:64px; }
button{ font:inherit; color:inherit; }
button:focus-visible,a:focus-visible,summary:focus-visible,[role="radio"]:focus-visible{ outline:2px solid var(--gold); outline-offset:2px; }
.field{ margin-bottom:12px; }
.field:last-child{ margin-bottom:0; }
.field.gapfield{ margin-top:14px; max-width:340px; }
.field label{ display:block; font-size:12px; font-weight:800; color:var(--inksoft); margin-bottom:5px; }
.two{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 10px; }
.three{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:0 10px; }
.four{ display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:0 10px; }
.two .field:last-child, .three .field:last-child, .four .field:last-child{ margin-bottom:12px; }
.four label{ min-height:2.5em; display:flex !important; align-items:flex-end; }
.joined{ display:flex; gap:8px; }
.joined select:first-child{ flex:1.5 1 0; }
.joined select:last-child{ flex:1 1 0; }
.note{ font-size:13px; color:var(--inksoft); margin:-2px 0 12px; }
.note:last-child{ margin-bottom:0; }
.note.count{ text-align:right; margin-top:-8px; }
.note.center{ text-align:center; margin-top:10px; }
.note.gapnote{ margin-top:12px; }
.note a, .more a{ color:var(--maroon); font-weight:700; }
.note code{ font-size:12.5px; background:#f1e9d8; border-radius:5px; padding:1px 5px; }
.hintline{ font-size:13px; color:var(--inksoft); }
.linkbtn{ border:none; background:none; color:var(--maroon); font-weight:700; font-size:13px; text-decoration:underline; cursor:pointer; padding:0; text-align:left; }
.warn{ font-size:13.5px; font-weight:600; color:#8a5a00; background:#fdf3d7; border:1.5px solid #ecd9a0; border-radius:10px; padding:9px 12px; margin:12px 0; }
.empty{ color:var(--inksoft); font-size:14px; padding:14px 4px; text-align:center; }

.btn{ display:inline-flex; align-items:center; justify-content:center; gap:6px; font-size:14px; font-weight:800; padding:11px 16px; border:1.5px solid var(--maroon); border-radius:10px; background:#fff; color:var(--maroon); cursor:pointer; text-decoration:none; text-align:center; }
.btn.solid{ background:var(--maroon); color:#fff; }
.btn.teal{ background:var(--gold); border-color:var(--gold); color:#fff; }
.btn.wa{ background:#1fa855; border-color:#1fa855; color:#fff; }
.btn.ghost{ border-color:var(--line); }
.btn.sm{ font-size:13px; padding:8px 12px; }
.btn[aria-disabled="true"]{ opacity:.45; }
.btn b{ font-weight:800; opacity:.7; }
.btnrow{ display:flex; gap:10px; flex-wrap:wrap; margin-top:12px; }
.btnrow.center{ justify-content:center; }
.filebtn{ position:relative; overflow:hidden; }
.filebtn input{ position:absolute; inset:0; opacity:0; cursor:pointer; width:100%; height:100%; padding:0; }
.filebtn:focus-within{ outline:2px solid var(--gold); outline-offset:2px; }

.chips{ display:flex; flex-wrap:wrap; gap:8px; }
.chip{ font-size:13.5px; font-weight:700; padding:7px 13px; border-radius:20px; border:1.5px solid var(--line); background:#fff; cursor:pointer; color:var(--ink); }
.chip[aria-checked="true"], .chip[aria-pressed="true"]{ border-color:var(--maroon); background:var(--maroon); color:#fff; }
.seg{ display:inline-flex; border:1.5px solid var(--line); border-radius:10px; overflow:hidden; background:#fff; flex:none; max-width:100%; }
.seg button{ font-size:13px; font-weight:800; padding:8px 12px; border:none; background:none; color:var(--inksoft); cursor:pointer; white-space:nowrap; }
.seg button[aria-pressed="true"], .seg button[aria-checked="true"]{ background:var(--maroon); color:#fff; }
.check{ display:flex; gap:9px; align-items:center; font-size:14px; font-weight:700; cursor:pointer; min-height:44px; margin-bottom:6px; }
.check input{ width:20px; height:20px; padding:0; flex:none; accent-color:var(--maroon); }
.check small{ display:block; font-weight:500; font-size:12.5px; color:var(--inksoft); }
.swatches{ display:flex; flex-wrap:wrap; gap:10px; padding-top:3px; }
.swatch{ width:34px; height:34px; border-radius:50%; border:2px solid #fff; box-shadow:0 0 0 1.5px var(--line); cursor:pointer; padding:0; }
.swatch[aria-checked="true"]{ box-shadow:0 0 0 2.5px var(--ink); }

/* ---------- the slip that is open ---------- */
.slipbar{ display:flex; align-items:center; gap:10px 16px; flex-wrap:wrap; padding:12px 16px; }
.sb-main{ display:flex; align-items:baseline; gap:10px; min-width:0; flex:1 1 200px; }
.sb-who{ font-family:"Fraunces",Georgia,serif; font-weight:900; font-size:19px; color:var(--maroon); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }
.sb-month{ font-size:14px; font-weight:600; color:var(--inksoft); white-space:nowrap; }
.sb-btns{ display:flex; gap:8px; margin-left:auto; flex-wrap:wrap; }

/* ---------- the editor ---------- */
.editor{ display:grid; grid-template-columns:minmax(0,1fr); }
details.fold > summary{ list-style:none; cursor:pointer; }
details.fold > summary::-webkit-details-marker{ display:none; }
details.fold > summary .step-label{ margin:0; }
details.fold > summary .step-label > span:first-child::after{ content:"▾"; margin-left:8px; font-size:13px; display:inline-block; transition:transform .15s; }
details.fold[open] > summary .step-label > span:first-child::after{ transform:rotate(180deg); }
.foldbody{ margin-top:14px; }
.logorow{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:10px; }
.logorow img{ height:44px; max-width:130px; object-fit:contain; border:1.5px solid var(--line); border-radius:8px; background:#fff; padding:3px; }

.extras{ list-style:none; }
.extras li{ display:grid; grid-template-columns:minmax(0,180px) minmax(0,1fr) auto; gap:8px; align-items:center; margin-bottom:8px; }
.extras input[data-f="l"]{ font-weight:700; }
.addchips .chip{ font-size:12.5px; padding:5px 10px; color:var(--inksoft); }
.addchips .chip.own{ border-style:dashed; color:var(--maroon); }
.addchips{ margin-top:4px; }

.starts{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; background:#f6efe1; border-radius:12px; padding:10px 12px; margin-bottom:12px; }
.starts .chip{ font-size:13px; padding:6px 12px; }
.lines{ list-style:none; }
.ln{ display:grid; grid-template-columns:minmax(0,1fr) 130px auto; gap:8px; align-items:center; margin-bottom:8px; border-radius:10px; }
.ln.flash{ animation:flash 1s; }
@keyframes flash{ 0%,60%{ box-shadow:0 0 0 3px rgba(11,125,116,.22); } 100%{ box-shadow:none; } }
.ln-name{ font-weight:700; }
.ln-amt{ text-align:right; font-weight:700; }
.ln-acts{ display:flex; gap:4px; }
.ib{ display:inline-flex; align-items:center; justify-content:center; font-size:13px; font-weight:800; min-width:32px; padding:6px 8px; border-radius:9px; border:1.5px solid var(--line); background:#fff; color:var(--maroon); text-decoration:none; cursor:pointer; white-space:nowrap; }
.ib:disabled{ opacity:.3; cursor:default; }
.ib.del{ color:var(--bad); }
.sumbox{ margin-top:16px; border-top:1.5px solid var(--line); padding-top:10px; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:5px 16px; font-size:14.5px; }
.sumbox dt{ color:var(--inksoft); }
.sumbox dd{ text-align:right; font-weight:700; white-space:nowrap; }
.sumbox .tot{ font-size:19px; font-weight:800; color:var(--ink); padding-top:6px; border-top:1.5px solid var(--line); margin-top:4px; }
.sumbox dd.tot{ color:var(--maroon); }
.sumbox .words{ grid-column:1 / -1; font-size:12.5px; color:var(--inksoft); text-align:right; white-space:normal; font-weight:600; }
.termchips .chip{ font-size:12.5px; padding:5px 10px; border-style:dashed; text-align:left; border-radius:12px; max-width:100%; }
.termchips{ margin-bottom:10px; }
.termchips:empty{ display:none; }

/* the slip */
.paper{ display:block; width:100%; max-width:440px; margin:0 auto; padding:0; border:none; background:#fff; cursor:zoom-in; border-radius:6px; overflow:hidden; box-shadow:0 14px 34px -16px rgba(34,26,18,.55), 0 0 0 1px rgba(34,26,18,.1); }
.paper canvas{ display:block; width:100%; aspect-ratio:794 / 1123; }
@media(min-width:960px){
  .editor{ grid-template-columns:minmax(0,1fr) 404px; column-gap:18px; align-items:start; }
  .editor > .panel{ grid-column:1; }
  .editor > .side{ grid-column:2; grid-row:1 / span 5; position:sticky; top:14px; }
  .sendgrid{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 18px; align-items:start; }
  .sendgrid .sendrow{ margin-top:22px; }
  .totalbar{ display:none !important; }
}

/* ---------- sending ---------- */
.sendrow{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:0 0 12px; }
.sendrow .btn{ padding:10px 8px; font-size:13.5px; }
.linkbox{ display:flex; gap:8px; margin-bottom:12px; }
.linkbox input{ font-size:13px; color:var(--inksoft); }
.linkbox .btn{ white-space:nowrap; }

/* ---------- the list of slips ---------- */
.gtools{ margin-bottom:8px; }
.gtools:empty, .gtools .chips:empty{ display:none; }
.gtools .chip{ font-size:12.5px; padding:5px 11px; }
.slips{ list-style:none; max-height:560px; overflow:auto; }
.slip{ display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; align-items:center; border-bottom:1px dashed var(--line); padding:4px 0; }
.slip:last-child{ border-bottom:none; }
.slip.cur{ background:#eef3fa; margin:0 -8px; padding:4px 8px; border-radius:10px; border-bottom-color:transparent; }
.zopen{ display:grid; grid-template-columns:minmax(0,1fr) auto; gap:1px 12px; text-align:left; border:none; background:none; cursor:pointer; padding:7px 0; min-width:0; }
.zopen .zw{ font-weight:700; font-size:15px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.zopen .zt{ font-weight:800; font-size:15px; white-space:nowrap; text-align:right; }
.zopen .zn{ grid-column:1 / -1; font-size:12.5px; color:var(--inksoft); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.zacts{ display:flex; gap:5px; }

/* net pay, always in reach on a phone */
.totalbar{ position:fixed; left:0; right:0; bottom:0; z-index:15; display:flex; align-items:center; gap:8px; padding:9px 14px calc(9px + env(safe-area-inset-bottom)); background:var(--paper); border-top:1.5px solid var(--line); box-shadow:0 -10px 24px -18px rgba(34,26,18,.6); }
.tb-sum{ flex:1 1 0; min-width:0; line-height:1.2; }
.tb-sum span{ display:block; font-size:11px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; color:var(--inksoft); }
.tb-sum b{ font-size:19px; font-weight:800; color:var(--maroon); white-space:nowrap; }
@media(max-width:959px){
  body:not(.viewing) footer.site{ padding-bottom:calc(92px + env(safe-area-inset-bottom)); }
  body:not(.viewing) .toast{ bottom:calc(76px + env(safe-area-inset-bottom)); }
}

/* the slip, full size */
dialog.zoom{ border:none; padding:0; width:min(100vw, 860px); max-width:100vw; max-height:100dvh; height:100dvh; margin:auto; background:#5c544a; }
dialog.zoom::backdrop{ background:rgba(34,26,18,.7); }
.zoombar{ position:sticky; top:0; z-index:1; display:flex; justify-content:space-between; align-items:center; gap:10px; padding:10px 14px; background:var(--paper); border-bottom:1.5px solid var(--line); font-weight:800; font-size:14px; }
.zoompages{ padding:14px; display:grid; gap:14px; }
.zoompages canvas{ display:block; width:100%; aspect-ratio:794 / 1123; background:#fff; box-shadow:0 10px 30px -12px rgba(0,0,0,.6); }

/* ---------- what an employee sees (/salary-slip/view/) ---------- */
body.viewing main{ max-width:860px; }
.vhead{ text-align:center; margin-bottom:16px; }
.vpages{ display:grid; gap:16px; margin-bottom:18px; }
.vpages canvas{ display:block; width:100%; aspect-ratio:794 / 1123; background:#fff; border-radius:6px; box-shadow:0 22px 44px -22px rgba(34,26,18,.6), 0 0 0 1px rgba(34,26,18,.1); }
.vactions{ display:flex; flex-wrap:wrap; gap:10px; justify-content:center; margin-bottom:18px; }
.vfoot{ text-align:center; font-size:13.5px; color:var(--inksoft); margin-top:22px; }
.vfoot a{ color:var(--maroon); font-weight:700; }

/* ---------- the reading part ---------- */
details.faq{ border-top:1.5px solid var(--line); padding:11px 0; }
details.faq:first-of-type{ border-top:none; padding-top:2px; }
details.faq summary{ cursor:pointer; font-weight:700; font-size:14.5px; }
details.faq p{ color:var(--inksoft); font-size:14px; margin-top:6px; }
.occasions{ display:flex; flex-wrap:wrap; gap:8px; margin-bottom:14px; }
.occasions a{ font-size:13.5px; font-weight:700; padding:7px 13px; border-radius:20px; border:1.5px solid var(--line); background:#fff; color:var(--maroon); text-decoration:none; }
.more{ font-size:13.5px; color:var(--inksoft); }
footer.site{ text-align:center; color:var(--inksoft); font-size:13px; padding:24px 16px 30px; margin-top:auto; }
footer.site a{ color:var(--maroon); }

.toast{ position:fixed; left:50%; bottom:calc(18px + env(safe-area-inset-bottom)); transform:translate(-50%,20px); background:var(--ink); color:#fff; font-size:14px; font-weight:600; padding:11px 16px; border-radius:12px; box-shadow:0 12px 30px -10px rgba(34,26,18,.6); opacity:0; pointer-events:none; transition:opacity .2s, transform .2s; display:flex; gap:14px; align-items:center; max-width:calc(100vw - 32px); z-index:40; }
.toast.on{ opacity:1; transform:translate(-50%,0); pointer-events:auto; }
.toast button{ border:none; background:none; color:#ffd98a; font-weight:800; font-size:14px; cursor:pointer; padding:0; white-space:nowrap; }

#printArea{ display:none; }

@media(max-width:640px){
  h1.title{ font-size:25px; }
  .three{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  .three .field:first-child{ grid-column:1 / -1; }
  .four{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  .sendrow{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  .sb-btns{ margin-left:0; width:100%; }
  .sb-btns .btn{ flex:1 1 auto; }
  .ln{ grid-template-columns:minmax(0,1fr) 104px; }
  .ln-acts{ grid-column:1 / -1; justify-content:flex-end; margin-top:-2px; }
  .extras li{ grid-template-columns:minmax(0,1fr) auto; }
  .extras li input[data-f="v"]{ grid-column:1 / -1; grid-row:2; }
  .zacts{ flex-direction:column; }
}
@media(max-width:420px){
  .two{ grid-template-columns:minmax(0,1fr); }
  .seg button{ padding:8px 9px; font-size:12.5px; }
}
@media print{
  @page{ size:A4; margin:0; }
  body > *:not(#printArea){ display:none !important; }
  html,body{ height:auto; background:#fff; display:block; min-height:0; }
  #printArea{ display:block; }
  #printArea img{ display:block; width:210mm; height:296.5mm; break-after:page; page-break-after:always; }
  #printArea img:last-child{ break-after:auto; page-break-after:auto; }
}
