@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }
button, input, select, textarea { font-family: 'Nunito', sans-serif; }

:root {
  --cream: #FFF8F0;
  --salmon: #FA8072;
  --salmon-light: #FFB4A8;
  --salmon-dark: #e86f62;
  --wasabi: #8DB560;
  --wasabi-light: #B8D89A;
  --wasabi-dark: #6B9340;
  --rice: #FFF5E6;
  --nori: #3D3D3D;
  --pink: #FFD1DC;
  --peach: #FFDAB9;
  --ink: #1B2836;
  --muted: #6B6259;
}

body {
  font-family: 'Nunito', sans-serif;
  background: var(--cream);
  color: var(--nori);
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

.app {
  width: 100%;
  max-width: 440px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--cream);
}

.app-top {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 1rem 1.3rem;
  border-bottom: 1px solid var(--peach);
}
.app-top .logo {
  width: 32px; height: 32px; border-radius: 9px;
  object-fit: cover; display: block;
}
.app-top b { font-size: 1rem; font-weight: 800; flex: 1; }
.app-top .logout-btn { color: var(--nori); font-weight: 700; font-size: 0.78rem; border: 1.5px solid var(--peach); border-radius: 16px; padding: 5px 12px; text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }

.body { flex: 1; padding: 1.5rem 1.3rem; display: flex; flex-direction: column; }

.btn {
  border: none; cursor: pointer; width: 100%;
  padding: 1rem; border-radius: 50px;
  font-family: 'Nunito'; font-weight: 800; font-size: 1.05rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  transition: transform 0.15s; text-decoration: none;
}
.btn:active { transform: scale(0.98); }
.btn-go { background: var(--wasabi-dark); color: #fff; box-shadow: 0 6px 18px rgba(107,147,64,0.35); }
.btn-out { background: var(--salmon); color: #fff; box-shadow: 0 6px 18px rgba(250,128,114,0.35); }
.btn-ghost { background: transparent; color: var(--muted); border: 2px solid var(--peach); font-weight: 700; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

.center-col { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
h2.title { font-size: 1.4rem; font-weight: 800; margin-bottom: 0.4rem; }
.sub { color: var(--muted); font-size: 0.92rem; margin-bottom: 1.6rem; line-height: 1.5; }

/* code entry */
.code-input {
  width: 100%; text-align: center; letter-spacing: 0.5rem;
  font-family: 'Nunito'; font-weight: 800; font-size: 1.8rem;
  text-transform: uppercase; color: var(--nori);
  padding: 1rem; border-radius: 16px; border: 2px solid var(--peach);
  background: #fff; margin-bottom: 1.4rem;
}
.code-input:focus { outline: none; border-color: var(--wasabi); }
.code-input::placeholder { color: #C9C0B4; letter-spacing: 0.5rem; }

/* greeting / status */
.greeting { font-size: 1.5rem; font-weight: 800; }
.date { color: var(--muted); font-size: 0.9rem; margin-bottom: 1.3rem; }
.status-card {
  background: #fff; border-radius: 18px; padding: 1.2rem;
  box-shadow: 0 6px 20px rgba(0,0,0,0.05); margin-bottom: 1.1rem;
  border: 1px solid #f4ece1;
}
.pill { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.7rem; border-radius: 50px; font-size: 0.74rem; font-weight: 800; }
.pill-out { background: var(--pink); color: #b54a5e; }
.pill-in { background: var(--wasabi-light); color: var(--wasabi-dark); }
.status-card .big { font-size: 1.1rem; font-weight: 800; margin: 0.6rem 0 0.15rem; }
.status-card .muted { color: var(--muted); font-size: 0.82rem; }
.log-row { display: flex; align-items: center; gap: 0.6rem; font-size: 0.85rem; color: var(--muted); padding: 0.5rem 0; }
.log-row .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--wasabi); flex-shrink: 0; }
.spacer { flex: 1; min-height: 1rem; }

/* capture */
.selfie-wrap { position: relative; width: 100%; aspect-ratio: 1; border-radius: 22px; overflow: hidden; margin-bottom: 1rem;
  background: linear-gradient(160deg, #FFE3D6, #FFD1DC 60%, #B8D89A); display: flex; align-items: center; justify-content: center; }
.selfie-wrap video, .selfie-wrap img { width: 100%; height: 100%; object-fit: cover; }
.selfie-wrap video { transform: scaleX(-1); }   /* mirror live preview only; saved JPEG stays true */
.selfie-wrap .placeholder { font-size: 3.5rem; }
.selfie-wrap .ring { position: absolute; inset: 14px; border: 3px dashed rgba(255,255,255,0.7); border-radius: 16px; pointer-events: none; }
.hidden-file { display: none; }
.meta-chip { display: flex; align-items: center; gap: 0.5rem; background: #fff; border-radius: 12px; padding: 0.7rem 0.85rem;
  font-size: 0.84rem; font-weight: 700; margin-bottom: 0.55rem; border: 1px solid #f4ece1; color: var(--muted); }
.meta-chip.ok { color: var(--wasabi-dark); }
.meta-chip.bad { color: var(--salmon-dark); background: #FFE0E0; border-color: #f7c5bd; }
.meta-chip.warn { color: #8A6B26; background: #FBF1D9; border-color: #f0d9a8; }
.meta-chip .ic { font-size: 1.05rem; }
.meta-chip .r { font-weight: 400; font-size: 0.76rem; opacity: 0.85; }
.meta-chip .retry { margin-left: auto; border: 1.5px solid currentColor; background: #fff; color: inherit; border-radius: 12px; padding: 2px 10px; font-family: 'Nunito'; font-weight: 800; font-size: 0.72rem; cursor: pointer; }
.btn.btn-flag { background: var(--salmon); }
.spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* success */
.check { width: 92px; height: 92px; border-radius: 50%; background: var(--wasabi-light); color: var(--wasabi-dark);
  display: flex; align-items: center; justify-content: center; font-size: 3rem; margin-bottom: 1.2rem; }
.receipt { background: #fff; border-radius: 16px; padding: 1rem 1.1rem; width: 100%; border: 1px solid #f4ece1; margin-bottom: 1.4rem; }
.receipt .r { display: flex; justify-content: space-between; font-size: 0.9rem; padding: 0.4rem 0; color: var(--muted); }
.receipt .r b { color: var(--nori); font-weight: 700; }

/* profile / settings */
.input { width: 100%; padding: 0.85rem 1rem; border-radius: 14px; border: 2px solid var(--peach); background: #fff; font-family: 'Nunito'; font-weight: 700; font-size: 1rem; color: var(--nori); margin-bottom: 1rem; }
.input:focus { outline: none; border-color: var(--wasabi); }
.input-label { display: block; font-size: 0.8rem; font-weight: 800; color: var(--muted); margin-bottom: 0.4rem; }
.avatar-pick { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 120px; height: 120px; border-radius: 50%; background: var(--rice); border: 2px dashed var(--peach); margin: 0 auto 1.4rem; cursor: pointer; overflow: hidden; color: var(--muted); font-weight: 800; font-size: 0.78rem; text-align: center; line-height: 1.4; }
.avatar-pick img { width: 100%; height: 100%; object-fit: cover; }

.msg { padding: 0.8rem 1rem; border-radius: 12px; font-weight: 700; font-size: 0.88rem; margin-bottom: 1rem; }
.msg-error { background: #FFE0E0; color: #c0392b; }
.msg-info { background: var(--wasabi-light); color: var(--wasabi-dark); }

/* Header avatar — tap to open your profile (photo when set, initials on your color) */
.me-avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; font-weight: 800; color: #fff; font-size: 0.78rem; text-decoration: none;
  overflow: hidden; flex-shrink: 0; }
.me-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Today's plan cards — same status language as the admin timesheet */
.sect-label { font-size: 0.78rem; font-weight: 800; color: var(--muted); text-transform: uppercase;
  letter-spacing: 1px; margin: 1.1rem 0 0.45rem; }
.plan-card { display: flex; align-items: center; gap: 0.7rem; background: #fff; border: 1px solid #f0e7da;
  border-left: 4px solid #e3d6c4; border-radius: 12px; padding: 0.7rem 0.85rem; margin-bottom: 0.5rem; }
.plan-card .pmain { flex: 1; min-width: 0; }
.plan-card .pname { font-weight: 800; font-size: 0.9rem; }
.plan-card .ptime { font-size: 0.76rem; color: var(--muted); font-weight: 700; }
.plan-card.p-ok { border-left-color: #7CAF4E; }
.plan-card.p-late { border-left-color: #F4B942; }
.plan-card.p-miss { border-left-color: #F0777F; }
.pv { font-weight: 800; font-size: 0.76rem; }
.pv-ok { color: #5c8836; } .pv-late { color: #ab7c14; } .pv-miss { color: #cf5560; }
.pv-pend { color: var(--muted); }
.avatar-hint { text-align: center; font-size: 0.76rem; color: var(--muted); font-weight: 700;
  margin: -0.4rem 0 0.8rem; }

/* My schedule — read-only two-week list */
.schedday { display: flex; gap: 0.9rem; align-items: flex-start; background: #fff; border: 1px solid #f0e7da;
  border-radius: 12px; padding: 0.65rem 0.85rem; margin-bottom: 0.5rem; }
.schedday.istoday { border-color: var(--peach); box-shadow: 0 0 0 1.5px var(--peach); }
.sdate { text-align: center; min-width: 34px; }
.sdow { font-size: 0.66rem; font-weight: 800; color: var(--muted); text-transform: uppercase; }
.sdnum { font-size: 1.05rem; font-weight: 800; }
.sbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.sstop { display: flex; justify-content: space-between; gap: 0.6rem; font-size: 0.88rem; }
.sstop b { font-weight: 800; }
.sstop span { color: var(--muted); font-weight: 700; white-space: nowrap; }
.soff { color: #d9d2c6; font-weight: 700; font-size: 0.86rem; }
.holchip { display: inline-block; background: var(--pink); color: #b54a5e; font-weight: 800;
  font-size: 0.7rem; border-radius: 50px; padding: 0.18rem 0.6rem; align-self: flex-start; }
.leavechip { display: inline-block; font-weight: 800; font-size: 0.7rem; border-radius: 50px;
  padding: 0.18rem 0.6rem; align-self: flex-start; }
.leavechip.sick { background: #FFE4EC; color: #c0506f; }
.leavechip.vac { background: #DDEDF7; color: #3d7ea6; }

/* Leave request form */
.leave-form label { display: block; font-weight: 800; font-size: 0.78rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.4px; margin: 0.9rem 0 0.35rem; }
.leave-form label .opt { font-weight: 600; text-transform: none; letter-spacing: 0; }
.leave-form .field { width: 100%; padding: 0.85rem 0.95rem; border-radius: 14px; border: 2px solid var(--peach);
  background: #fff; font-size: 0.95rem; color: var(--nori); margin-bottom: 0.2rem; }
.leave-form .field:focus { outline: none; border-color: var(--wasabi); }
.leave-form textarea.field { resize: vertical; min-height: 72px; }
.kindrow { display: flex; gap: 0.55rem; }
.kindopt { flex: 1; margin: 0 !important; cursor: pointer; }
.kindopt input { position: absolute; opacity: 0; pointer-events: none; }
.kindopt span { display: block; text-align: center; padding: 0.85rem 0.5rem; border-radius: 14px;
  border: 2px solid var(--peach); background: #fff; font-weight: 800; font-size: 0.9rem;
  text-transform: none; letter-spacing: 0; color: var(--nori); }
.kindopt input:checked + span { border-color: var(--salmon); background: #fff5f3; color: var(--salmon-dark); }
.daterow { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; }
.leave-form .btn-go { margin-top: 1.2rem; }
.leavereq { background: #fff; border: 1px solid #f0e7da; border-radius: 12px; padding: 0.75rem 0.9rem; margin-bottom: 0.55rem; }
.lr-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.lr-status { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; }
.st-pending { color: #ab7c14; }
.st-approved { color: #5c8836; }
.st-denied { color: #cf5560; }
.st-cancelled { color: var(--muted); }
.lr-dates { margin-top: 0.4rem; font-weight: 800; font-size: 0.9rem; }
.lr-days { color: var(--muted); font-weight: 700; }
.lr-note { margin-top: 0.3rem; color: var(--muted); font-size: 0.82rem; font-weight: 600; line-height: 1.4; }
.btn-text { border: none; background: none; cursor: pointer; font-family: 'Nunito'; font-weight: 800;
  font-size: 0.78rem; color: var(--salmon-dark); padding: 0; }

.ot-card { background: #fff; border: 1px solid #f0e7da; border-radius: 14px; padding: 0.9rem 1rem; margin-bottom: 0.6rem; }
.ot-card .field { width: 100%; padding: 0.75rem 0.85rem; border-radius: 12px; border: 2px solid var(--peach);
  background: #fff; font-size: 0.9rem; color: var(--nori); resize: vertical; }
.ot-card .field:focus { outline: none; border-color: var(--wasabi); }
.ot-mins { font-weight: 800; font-size: 1rem; margin-bottom: 0.35rem; color: var(--salmon-dark); }
.ot-banner { background: #FFF1D6; color: #9a6a00; font-weight: 800; font-size: 0.84rem;
  border-radius: 12px; padding: 0.7rem 0.9rem; margin: 0.8rem 0 0.4rem; text-align: center; }

/* Team today (supervisors) — one row per person, dots per scheduled stop */
.teamrow { display: flex; align-items: center; gap: 0.7rem; background: #fff; border: 1px solid #f0e7da;
  border-radius: 12px; padding: 0.6rem 0.85rem; margin-bottom: 0.5rem; }
.tinfo { flex: 1; min-width: 0; }
.tname { font-weight: 800; font-size: 0.9rem; }
.tstatus { font-size: 0.76rem; color: var(--muted); font-weight: 700; }
.tstatus.bad { color: #cf5560; }
.tdotsrow { display: inline-flex; gap: 4px; }
.dot { width: 14px; height: 14px; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; flex-shrink: 0; }
.d-ok { background: #7CAF4E; }
.d-late { background: #F4B942; }
.d-miss { background: #F0777F; }
.d-pending { background: transparent; border: 2px dashed #e3d6c4; }
