/* =====================================================================
   Sunice — Tablet modules (Fabriek & Chauffeur)
   Portrait, big tap targets, tuned for a Samsung A-series tab.
   ===================================================================== */

.tab { max-width: 600px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }

/* --- Top bar -------------------------------------------------------- */
.tabbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: .7rem;
  padding: .7rem 1rem; background: rgba(255,255,255,.86);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.tabbar img.logo { width: 36px; height: 36px; border-radius: 10px; }
.tabbar .wm { font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; line-height: 1; }
.tabbar .wm small { display: block; font-family: var(--font-ui); font-weight: 700; font-size: .58rem; letter-spacing: .18em; text-transform: uppercase; color: var(--sky-700); margin-top: 2px; }
.tabbar .who { margin-left: auto; text-align: right; font-size: .8rem; }
.tabbar .who b { display: block; font-size: .9rem; }
.tabbar .who a { font-size: .76rem; }
.tabbar .back { font-size: 1.5rem; color: var(--sky-700); text-decoration: none; line-height: 1; padding: .2rem .4rem; margin-left: -.3rem; }

.tab-main { flex: 1; padding: 1rem 1rem 7rem; }
.tab-h { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; margin: .3rem 0 1rem; }
.tab-h h1 { font-size: 1.45rem; }
.tab-h .date { font-size: .92rem; color: var(--muted); font-weight: 600; }

/* --- PIN login ------------------------------------------------------ */
.loginpane { max-width: 460px; margin: 0 auto; padding: 1.4rem 1rem 2rem; }
.loginpane .brandtop { text-align: center; margin: 1.4rem 0 1.6rem; }
.loginpane .brandtop img { width: 84px; height: 84px; border-radius: 22px; margin: 0 auto .7rem; box-shadow: var(--shadow); }
.loginpane .brandtop .wm { font-family: var(--font-display); font-weight: 700; font-size: 2rem; }
.loginpane .brandtop .mod { display: inline-block; margin-top: .5rem; font-weight: 700; font-size: .8rem; letter-spacing: .16em; text-transform: uppercase; color: #fff; background: var(--sky); padding: .3rem .8rem; border-radius: 999px; }
.loginpane .brandtop .mod.factory { background: var(--sun); color: #3a2606; }

.userpick { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; }
.userpick button {
  display: flex; align-items: center; gap: .7rem; text-align: left;
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-lg);
  padding: .9rem 1rem; transition: border-color .14s, transform .1s, box-shadow .14s;
}
.userpick button:hover, .userpick button:focus-visible { border-color: var(--sky); outline: none; box-shadow: var(--ring); }
.userpick button:active { transform: scale(.98); }
.userpick .av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--steel); flex: none; font-size: .9rem; }
.userpick .nm { font-weight: 700; line-height: 1.15; }

/* PIN keypad */
.pinwrap { max-width: 320px; margin: 0 auto; text-align: center; }
.pindots { display: flex; justify-content: center; gap: .8rem; margin: 1.4rem 0; }
.pindots i { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid var(--line); transition: background .12s, border-color .12s; }
.pindots i.on { background: var(--sky); border-color: var(--sky); }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; }
.pinpad button {
  font-family: var(--font-display); font-weight: 600; font-size: 1.7rem; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-lg);
  min-height: 58px;            /* fallback if aspect-ratio is unsupported */
  aspect-ratio: 1.7 / 1; transition: background .1s, transform .08s;
}
.pinpad button:active { background: var(--frost-2); transform: scale(.97); }
.pinpad button.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--sky-700); font-family: var(--font-ui); font-size: 1rem; font-weight: 700; }

/* --- Tap cards (queue / delivery list) ------------------------------ */
.tapcards { display: flex; flex-direction: column; gap: .7rem; }
.tapcard {
  display: block; background: #fff; border: 1px solid var(--line); border-left: 6px solid var(--tone, var(--sky));
  border-radius: var(--r-lg); padding: .95rem 1rem; box-shadow: var(--shadow-sm);
  text-decoration: none; color: var(--ink); transition: transform .1s, box-shadow .16s;
}
.tapcard:hover { text-decoration: none; }
.tapcard:active { transform: scale(.99); box-shadow: var(--shadow); }
.tapcard .top { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .35rem; }
.tapcard .ono { font-family: var(--font-mono); font-size: .82rem; color: var(--muted); }
.tapcard .cust { font-family: var(--font-display); font-weight: 600; font-size: 1.18rem; line-height: 1.1; }
.tapcard .meta { display: flex; align-items: center; gap: .9rem; margin-top: .5rem; font-size: .86rem; color: var(--ink-soft); flex-wrap: wrap; }
.tapcard .meta .i { display: inline-flex; align-items: center; gap: .3rem; }
.tapcard .chev { color: var(--muted); font-size: 1.3rem; }

/* --- Big info rows -------------------------------------------------- */
.deliverhead { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.1rem; margin-bottom: 1rem; }
.deliverhead .cust { font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; line-height: 1.1; }
.deliverhead .addr { color: var(--ink-soft); margin-top: .35rem; }
.deliverhead .ono { font-family: var(--font-mono); color: var(--muted); font-size: .85rem; margin-top: .5rem; }
.deliverhead .tel { display: inline-flex; align-items: center; gap: .4rem; margin-top: .7rem; font-weight: 700; color: var(--sky-700); }

/* --- Prep checklist ------------------------------------------------- */
.checkitems { display: flex; flex-direction: column; gap: .55rem; }
.checkitem {
  display: flex; align-items: center; gap: .85rem; width: 100%; text-align: left;
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-md); padding: .85rem 1rem;
  transition: border-color .14s, background .14s;
}
.checkitem .box { width: 30px; height: 30px; border-radius: 9px; border: 2px solid var(--line); flex: none; display: grid; place-items: center; color: #fff; font-weight: 900; background: #fff; transition: background .14s, border-color .14s; }
.checkitem .qty { font-family: var(--font-mono); font-weight: 700; color: var(--sky-700); min-width: 3.2em; }
.checkitem .desc { font-weight: 600; line-height: 1.2; }
.checkitem .sub { font-size: .78rem; color: var(--muted); }
.checkitem.done { background: #EBF8F1; background: color-mix(in srgb, var(--fresh) 8%, #fff); border-color: #BFE7D2; border-color: color-mix(in srgb, var(--fresh) 40%, #fff); }
.checkitem.done .box { background: var(--fresh); border-color: var(--fresh); }
.checkitem.done .desc { text-decoration: line-through; color: var(--muted); }

/* =====================================================================
   The PAKBON ticket — the signature element
   ===================================================================== */
.pakbon {
  background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow);
  overflow: hidden; border: 1px solid var(--line);
}
.pakbon__cap {
  background: linear-gradient(135deg, var(--sky) 0%, var(--sky-700) 100%);
  color: #fff; padding: 1.1rem 1.2rem 1.4rem; position: relative;
}
.pakbon__cap::after { /* dripping snow edge */
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 14px;
  background: radial-gradient(12px 14px at 13px 0, #fff 96%, transparent 100%) repeat-x;
  background-size: 28px 14px;
}
.pakbon__cap .lbl { font-size: .7rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: #BfE6FA; }
.pakbon__cap .ono { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 700; letter-spacing: .02em; margin-top: .2rem; }
.pakbon__cap .sun { position: absolute; top: .9rem; right: 1rem; width: 38px; height: 38px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 6px rgba(246,178,60,.25); }
.pakbon__body { padding: 1.3rem 1.2rem 1.1rem; }
.pakbon__cust { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; }
.pakbon__addr { color: var(--ink-soft); font-size: .92rem; margin-top: .2rem; }
.pakbon__rows { width: 100%; border-collapse: collapse; margin: 1rem 0 .4rem; font-size: .95rem; }
.pakbon__rows th { text-align: left; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 0 0 .5rem; border-bottom: 1.5px solid var(--line); }
.pakbon__rows th.num, .pakbon__rows td.num { text-align: right; font-family: var(--font-mono); }
.pakbon__rows td { padding: .55rem 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.pakbon__rows tr:last-child td { border-bottom: 0; }

/* perforation divider */
.perf { position: relative; height: 24px; margin: .3rem -1.2rem; }
.perf::before { content: ""; position: absolute; top: 50%; left: 14px; right: 14px; border-top: 2.5px dashed var(--line); }
.perf::after  { content: ""; position: absolute; top: 50%; left: -12px; width: 24px; height: 24px; background: var(--frost); border-radius: 50%; transform: translateY(-50%); box-shadow: calc(100% + 24px) 0 0 var(--frost); }

/* --- Signature pad -------------------------------------------------- */
.signzone { padding: 0 1.2rem 1.3rem; }
.signbox { position: relative; border: 2px dashed var(--line); border-radius: var(--r-md); background: #FCFEFF; touch-action: none; }
.signbox canvas { display: block; width: 100%; height: 200px; border-radius: var(--r-md); }
.signbox .ph { position: absolute; inset: 0; display: grid; place-items: center; color: #B6C7DB; font-weight: 600; pointer-events: none; }
.signbox .ph.hide { display: none; }
.signbox .baseline { position: absolute; left: 16px; right: 16px; bottom: 38px; border-top: 1.5px solid var(--line); }
.signbox .xmark { position: absolute; left: 16px; bottom: 40px; color: var(--muted); font-weight: 800; }
.signrow { display: flex; justify-content: space-between; align-items: center; margin-top: .6rem; }
.signrow .clear { background: none; border: 0; color: var(--coral-600); font-weight: 700; font-size: .9rem; }

/* --- Sticky bottom action bar -------------------------------------- */
.bottombar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); padding: .8rem 1rem calc(.8rem + env(safe-area-inset-bottom));
}
.bottombar .inner { max-width: 600px; margin: 0 auto; display: flex; gap: .7rem; }
.bottombar .btn { flex: 1; }

/* --- Big choice buttons (akkoord ja/nee) ---------------------------- */
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.choice .btn { height: 64px; font-size: 1.15rem; }

/* --- Done screen ---------------------------------------------------- */
.doneart { text-align: center; padding: 2.5rem 1rem 1rem; }
.doneart .ring { width: 96px; height: 96px; border-radius: 50%; background: #DCF3E7; background: color-mix(in srgb, var(--fresh) 16%, #fff); display: grid; place-items: center; margin: 0 auto 1rem; }
.doneart .ring svg { width: 50px; height: 50px; }
.doneart h2 { font-size: 1.7rem; }

/* --- Modal (problem report) ---------------------------------------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(13,40,66,.45); z-index: 50; display: none; align-items: flex-end; }
.sheet-backdrop.open { display: flex; }
.sheet { background: #fff; width: 100%; max-width: 600px; margin: 0 auto; border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 1.3rem 1.2rem calc(1.3rem + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg); animation: sheetUp .3s ease both; }
@keyframes sheetUp { from { transform: translateY(100%); } }
.sheet h3 { font-size: 1.25rem; margin-bottom: .8rem; }
