:root {
  --canvas-w: 1920;
  --canvas-h: 1200;
  --brand-blue: #1386ff;
  --header-bg: #ffffff;
  --text-dark: #111;
  --key-bg: #e7eefb;
  --key-text: #1a2a44;
  --ok-green: #17c964;
    --nouser-bg: #a5452f;

  /* admin theme (brick red) */
  --admin-bg: #a94c55;    /* deep brick red */
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root { color-scheme: light; }
}

.app-canvas.admin-mode {
  background: var(--admin-bg);
}

/* App viewport and scaling */
html,
body {
  height: 100%;
  overflow: hidden;
  background: #000;
}

.app-viewport {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
}

.app-canvas {
  width: calc(var(--canvas-w) * 1px);
  height: calc(var(--canvas-h) * 1px);
  background: var(--brand-blue);
  color: #fff;
  display: flex;
  flex-direction: column;
  transform-origin: top left;
  /* Single scale formula: fit to the smaller side (use dynamic viewport height to ignore URL bar) */
  transform: scale(
    min(100vw / calc(var(--canvas-w) * 1px), 100dvh / calc(var(--canvas-h) * 1px))
  );
}

.app-viewport { align-items: start; justify-items: start; }
.app-canvas { margin: auto; transform-origin: 0 0; }

.app-canvas {
  /* 1920×1200 design scaled to fit either width or height */
  transform: scale(
    min(100vw / 1920, 100dvh / 1200)
  );
  transform-origin: 0 0;
}

/* Don’t upscale on giant screens (keeps 1:1 crispness) */
.app-canvas { transform: scale(min(1, min(100vw/1920, 100dvh/1200))); }

/* Fallback for older browsers without dvh */
@supports not (height: 100dvh) {
  .app-canvas { transform: scale(min(100vw/1920, 100vh/1200)); }
}

/* If your page has iOS safe areas */
html { background:#000; }
.app-viewport { padding: env(safe-area-inset); }

/* ===== UPPER PANEL (1/3) ===== */
.upper {
  height: 400px;
  background: var(--header-bg);
  color: var(--text-dark);
  border-bottom: 4px solid #000;
  padding: 24px 32px;
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
}

.upper-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.logo-img {
  max-height: 300px;
  width: auto;
  display: block;
}

.wordmark-img {
  height: 220px;
  width: auto;
  display: block;
}

.welcomeText {
  font-size: 1.75rem;
}

.count-bubble {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #ffb000;
  color: #fff;
  text-shadow: 1px 1px #33333399;
  border: 3px solid #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: farsan;
  font-weight: 700;
  font-size: 42px;
}

/* Admin gear — TOP RIGHT per your request */
.admin-icon {
  position: absolute;
  top: 12px;
  right: 16px;      /* << top-right */
  /* left: 16px; */ /* (leave commented if you ever want top-left instead) */
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #f2f2f2;
  color: #000;
  border: 2px solid #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  cursor: pointer;
}

/* ===== LOWER PANEL (2/3) ===== */
.lower {
  flex: 1;
  display: flex;
  padding: 24px 32px;
  gap: 24px;
}

.left-half {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.left-msg {
  color: #081a2b;
  font-family: farsan;
  font-size: 64px;
}

.pinbar {
  display: flex;
  gap: 36px;
  justify-content: flex-start;
  align-items: flex-end;
  margin-bottom: 12px;
}

.pin-slot {
  width: 120px;
  height: 100px;
  border-bottom: 6px solid #081a2b;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  color: #081a2b;
  font-size: 160px;
  font-family: farsan;
  font-weight: 600;
}

.right-half {
  flex: 1;
  display: flex;
  gap: 24px;
  align-items: center;
}

.pad-wrap {
  flex: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  justify-items: center;
}

.key {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: var(--key-bg);
  color: var(--key-text);
  border: 2px solid #9fb6e7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: farsan;
  font-weight: 700;
  font-size: 72px;
  user-select: none;
}

.key:active {
  transform: translateY(2px);
}

.submit-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

#bigCheck {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: var(--ok-green);
  border: 6px solid #0b7a36;
  color: #fff;
  font-size: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(.9);
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}

/* Footer */
.app-footer {
  color: #e6f0ff;
  display: flex;
  justify-content: space-between;
  padding: 10px 24px;
}





























































/* Whole-canvas background for No User mode */
.app-canvas.nouser-mode {
  background: var(--nouser-bg);
}

/* Center the lower panel contents in No User mode */
.app-canvas.nouser-mode .lower {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Centered stack for message + button */
.nouser-wrap {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  justify-content: center;
}

/* Big message style (inherits your font choices) */
.nouser-msg {
  color: #fff;
  font-size: 64px;         /* tweak as you like */
  line-height: 1.1;
  font-weight: 700;
}

/* Close button look */
.nouser-close.btn {
  padding: 12px 24px;
  font-size: 20px;
  border: 2px solid #000;
  border-radius: 10px;
}













/* =========================
   CHILD PAGE (your class names)
   ========================= */

/* Lower is a vertical stack for child pages */
.app-canvas.child-mode .lower {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 8px 24px 24px 24px;
  color: #fff;
}

/* Row 1: Welcome (L) | ID (R) with thin divider */
.child-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.25);
}

/* Row 2 container */
.child-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;   /* push left/right blocks to edges */
  gap: 16px;
  padding-top: 6px;
  flex-wrap: nowrap;                /* keep both on a single line */
  min-width: 0;
}

/* LEFT: icon + address (ensure icon stays left of lines) */
.address-card {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;                /* prevent wrapping above */
  min-width: 0;                     /* allow text to shrink if needed */

  /* remove any panel styling */
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
}

.edit-btn {
  flex: 0 0 40px;                   /* fixed icon box */
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,0.85);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;                  /* FA icon size */
  cursor: pointer;
  padding: 0;
}

.addr-text {
  flex: 1 1 auto;                   /* text takes remaining width */
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.addr-line {
  color: rgba(255,255,255,0.80);
}
.addr-line + .addr-line {
  color: rgba(255,255,255,0.70);
}

/* RIGHT: linked parents as plain inline text (no boxes) */
.parents-card {
  display: flex;
  align-items: center;
  gap: 12px;

  /* remove any panel styling */
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;

  flex: 0 0 auto;                   /* keep natural width on right */
  min-width: 0;
}

.parents-title {
  /* hide label or make very subtle—pick one: */
  /* display: none; */
  color: rgba(255,255,255,0.65);
  font-weight: 600;
  margin-right: 8px;
}

.parents-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 60vw;                  /* avoids overlap on very long names */
}

.parent-pill {
  /* make names look like plain text */
  border: 0;
  background: transparent;
  padding: 0;
  color: rgba(255,255,255,0.70);
  font-weight: 600;
}

/* Add comma between names if multiple <li> */
.parents-list > li + li::before {
  content: ", ";
  margin-right: 4px;
  color: rgba(255,255,255,0.70);
}













/* ===== Child cards (no borders, rounded 10–15px) ===== */

.child-cards-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;      /* vertical center */
  justify-content: center;  /* horizontal center */
  padding-top: 8px;
}

.child-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: stretch;
  justify-content: center;
  max-width: 100%;
}

.child-grid-empty {
  color: rgba(255, 255, 255, 0.75);
  font-weight: 600;
}

/* Base card */
.child-card {
  width: 360px;                 /* roomy; adjust as you prefer */
  height: 340px;
  border-radius: 12px;          /* 10–15px per your spec */
  color: #fff;

  display: flex;
  flex-direction: column;
  justify-content: space-between;

  /* no border */
  border: none;

  /* subtle lift on press */
  transition: transform .08s ease;
}
.child-card:active {
  transform: translateY(2px);
}

/* Transparent background by status */
.child-card.status-in {
  background: rgba(224, 58, 58, 0.502);     /* transparent red */
}
.child-card.status-out {
  background: rgba(23, 201, 100, 0.502);    /* transparent green */
}

/* Inner content stack */
.child-card-inner {
  padding: 20px 18px 0 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  text-align: center;
}

.child-card-name {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
}

.child-card-age {
  font-size: 18px;
  font-weight: 700;
  opacity: 0.9;
}

/* Icon image */
.child-card-image {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.child-card-image img {
  width: 120px;      /* generic icon size */
  height: auto;
  display: block;
}

/* Select bar (solid bg with 5px dark border) */
.select-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  padding: 12px 16px;
  border-radius: 0 0 12px 12px;   /* match card corners at bottom */
  border-width: 5px;              /* per your spec */
  border-style: solid;

  font-size: 22px;
  font-weight: 800;
}

/* Status-colored select bar + dark border */
.select-in {
  background: #e03a3a;           /* solid red */
  border-color: #7a1712;         /* dark red */
}
.select-out {
  background: #17c964;           /* solid green */
  border-color: #0b7a36;         /* dark green */
}

/* FA checkbox icon (not system checkbox) */
.select-icon {
  font-size: 24px;
  line-height: 1;
}
.select-text {
  line-height: 1;
}

/* Selection state on cards */
.child-card.selected .select-icon {
  /* change FA icon when selected */
  /* from fa-square to fa-check-square via JS by toggling class */
}
.child-card.selected .select-bar {
  outline: 3px solid rgba(255,255,255,0.7);
  outline-offset: -6px;
}

/* Actions bar below cards */
.child-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.child-actions-note {
  color: rgba(255,255,255,0.85);
  font-weight: 700;
}

.action-btn {
  min-width: 320px;
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 26px;
  font-weight: 900;
  border: 5px solid transparent;
  color: #fff;
}

/* Colors based on operation */
.action-btn.checkin {
  background: #17c964;
  border-color: #0b7a36;
}
.action-btn.checkout {
  background: #e03a3a;
  border-color: #7a1712;
}

/* util */
.d-none { display: none !important; }
















/* =========================
   Signature Panel (fixed sizing)
   ========================= */

.app-canvas.signature-mode .lower {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 24px 24px 24px;
  color: #fff;
}

.signature-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  height: 100%;
}

.sig-title {
  text-align: center;
  font-weight: 800;
}

.sig-row {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 120px; /* canvas | right button rail */
  gap: 16px;
  align-items: center;
}

/* Canvas box */
.sig-canvas-wrap {
  position: relative;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.2);
  height: 100%;
  min-height: 280px;
  overflow: hidden;
}

/* Make the canvas FILL its wrapper box */
#sigCanvas {
  width: 100%;
  height: 100%;
  display: block;           /* remove inline gap */
  border-radius: 12px;
  touch-action: none;       /* allow finger drawing */
  z-index: 2;
}

/* Dashed inner guide below canvas; does not intercept input */
.sig-dash {
  position: absolute;
  left: 16px; right: 16px; top: 16px; bottom: 16px;
  border-radius: 8px;
  border: 4px dashed #ef5a5a;
  pointer-events: none;
  z-index: 1;
}

/* Right-side buttons */
.sig-buttons {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: stretch;
  justify-content: center;
}

.sig-btn {
  height: 160px;
  border-radius: 10px;
  border: 4px solid rgba(0,0,0,0.25);
  color: #fff;
  font-size: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .06s ease;
}
.sig-btn:active { transform: translateY(2px); }

.sig-btn.ok   { background: #63d26d; }
.sig-btn.clear{ background: #d97862; }

.d-none { display: none !important; }

.sig-footer {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Signature: smaller pad + wider side gutters */
.app-canvas.signature-mode .lower {
  padding-left: 75px;
  padding-right: 75px;
}

/* Put the canvas rail inside 75px gutters as well (belt & suspenders) */
.sig-row {
  margin-left: 75px;
  margin-right: 75px;
}

/* Shrink drawing area to ~half the previous height */
.sig-canvas-wrap {
  height: 420px;     /* adjust to taste (380–460px works well on 1200px tall canvas) */
  min-height: 260px; /* safety floor */
}

/* Keep the dashed guide proportional after the height change */
.sig-dash {
  left: 16px; right: 16px; top: 16px; bottom: 16px;
}



/* Canvas is inset by 16px on all sides (same as the dashed guide) */
/* Canvas inset to the dashed box */
/* dashed guide sits ON TOP and never steals input */
.sig-dash {
  position: absolute;
  left: 24px;
  right: 24px;
  top: 24px;
  bottom: 24px;
  border-radius: 8px;
  border: 4px dashed #ef5a5a;
  pointer-events: none;
  z-index: 5; /* above canvas */
}

/* canvas lives just inside the dashed box (adds a small gap) */
#sigCanvas {
  position: absolute;
  left: 32px;   /* 24px inset + 4px dash + 4px gap */
  right: 32px;
  top: 32px;
  bottom: 32px;
  display: block;
  border-radius: 8px;
  touch-action: none;
  z-index: 4;   /* below dashed guide */
}

/* giant green check overlay */
.sig-success {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 240px;
  color: #17c964;
  background: rgba(0,0,0,0.25);
  border-radius: 12px;
  z-index: 9;
}