/* Cleaning jobs app (owner portal + staff app). Brand colours come from --a* set in app_base.html. Mobile first. */
:root { --ink: #0b1a10; --soft: #4d5e53; --faint: #8a9a90; --line: #e2ebe4; --bg: #f4f8f5; --card: #fff; --night: #06120a;
  --ok: #138a36; --warn: #b26a00; --bad: #c62828; --r: 20px; --ease: cubic-bezier(.2,.8,.2,1);
  --shadow: 0 1px 2px rgba(10,30,15,.04), 0 12px 32px -18px rgba(10,30,15,.18); }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.cj { margin: 0; font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background:
  radial-gradient(900px 400px at 100% -10%, var(--a-soft), transparent 70%), var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
h1, h2, h3, .cj-brand { font-family: "Plus Jakarta Sans", Inter, sans-serif; letter-spacing: -.02em; }
h1 { font-size: clamp(1.6rem, 4.5vw, 2.3rem); margin: 0 0 .3rem; line-height: 1.1; }
h2 { font-size: 1.22rem; margin: 0 0 .9rem; }
h3 { font-size: 1.02rem; margin: 0 0 .5rem; }
a { color: var(--a-text); }
p { line-height: 1.55; }
img { max-width: 100%; display: block; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 12px; top: 12px; z-index: 99; background: #fff; padding: .5rem 1rem; border-radius: 8px; }
.cj-wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.cj-main { flex: 1; padding: 1.4rem 0 6rem; }
.muted { color: var(--soft); } .faint { color: var(--faint); } .small { font-size: .86rem; }
@media (max-width: 719px) { .hide-sm { display: none !important; } }
@media (min-width: 720px) { .show-sm { display: none !important; } .cj-main { padding-bottom: 3rem; } }

/* top bar */
.cj-top { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.82); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.cj-top-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 62px; }
.cj-brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.1rem; color: inherit; text-decoration: none; min-width: 0; }
.cj-brand img { max-height: 36px; width: auto; }
.cj-brand em { font-style: normal; font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; background: var(--a); color: var(--a-ink); padding: .2rem .5rem; border-radius: 999px; }
.cj-mark { width: 30px; height: 30px; border-radius: 10px; background: conic-gradient(from 210deg, var(--a), #b8f5a6, var(--a)); box-shadow: 0 6px 18px -6px var(--a); position: relative; }
.cj-mark::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: rgba(255,255,255,.85); }
.cj-nav { display: flex; align-items: center; gap: .9rem; }
.cj-nav a:not(.cj-btn) { font-weight: 600; font-size: .92rem; color: var(--soft); text-decoration: none; }
.cj-nav a:not(.cj-btn):hover { color: var(--ink); }
.cj-nav form { margin: 0; }
.cj-icon-btn { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 1rem; color: var(--soft); }
.cj-net { font-size: .75rem; font-weight: 700; padding: .3rem .65rem; border-radius: 999px; background: var(--a-soft); color: var(--a-deep); }
.cj-net.off { background: #b26a00; color: #fff; } .cj-net.sync { background: #fff4e0; color: #9a5b00; }
.cj-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(3, 1fr); background: rgba(255,255,255,.94);
  backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.cj-tabbar a { display: grid; justify-items: center; gap: .1rem; padding: .55rem 0 .6rem; font-size: .72rem; font-weight: 700; color: var(--soft); text-decoration: none; }
.cj-tabbar a span { font-size: 1.1rem; line-height: 1; }
.cj-tabbar a.on span { width: 40px; height: 40px; margin-top: -18px; border-radius: 14px; display: grid; place-items: center; background: var(--a); color: var(--a-ink); box-shadow: 0 10px 22px -8px var(--a); }
.cj-foot { padding: 1.4rem 0 2rem; font-size: .82rem; color: var(--faint); text-align: center; }
.cj-foot a { color: inherit; }

/* buttons & forms */
.cj-btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 46px; padding: .7rem 1.25rem; border-radius: 14px; border: 1px solid transparent;
  font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer; text-decoration: none; transition: transform .2s var(--ease), box-shadow .25s var(--ease), background .2s; -webkit-tap-highlight-color: transparent; }
.cj-btn:active { transform: scale(.97); }
.cj-btn-primary { background: var(--a); color: var(--a-ink); box-shadow: 0 10px 24px -12px var(--a), inset 0 1px 0 rgba(255,255,255,.4); }
.cj-btn-primary:hover { box-shadow: 0 14px 30px -12px var(--a), inset 0 1px 0 rgba(255,255,255,.4); color: var(--a-ink); }
.cj-btn-dark { background: var(--ink); color: #fff; } .cj-btn-dark:hover { color: #fff; }
.cj-btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); } .cj-btn-ghost:hover { border-color: var(--a); color: var(--ink); }
.cj-btn-danger { background: #fff; border-color: #f3c7c7; color: var(--bad); }
.cj-btn-sm { min-height: 38px; padding: .45rem .9rem; font-size: .86rem; border-radius: 12px; }
.cj-btn-block { width: 100%; }
.cj-btn[disabled] { opacity: .5; cursor: not-allowed; }
.cj-btn-lg { min-height: 56px; font-size: 1.05rem; border-radius: 16px; }
label { display: block; font-weight: 600; font-size: .9rem; margin: 0 0 .35rem; }
.cj-field { margin-bottom: 1rem; }
.cj-field small { display: block; color: var(--faint); margin-top: .3rem; font-size: .8rem; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=time], input[type=number], select, textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: .72rem .9rem; transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--a); box-shadow: 0 0 0 4px color-mix(in srgb, var(--a) 22%, transparent); }
textarea { min-height: 88px; resize: vertical; }
.cj-row { display: grid; gap: 0 .9rem; }
@media (min-width: 640px) { .cj-row.two { grid-template-columns: 1fr 1fr; } .cj-row.three { grid-template-columns: repeat(3, 1fr); } }
.cj-check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 500; }
.cj-check input { width: 20px; height: 20px; accent-color: var(--a); margin-top: 2px; flex: none; }
:focus-visible { outline: 3px solid var(--a); outline-offset: 2px; }

/* cards */
.cj-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 1.2rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.cj-card-hero { background: linear-gradient(140deg, var(--night), #0c2615); color: #fff; border: 0; position: relative; overflow: hidden; }
.cj-card-hero::after { content: ""; position: absolute; width: 320px; height: 320px; right: -80px; top: -120px; border-radius: 50%; background: var(--a); opacity: .28; filter: blur(50px); }
.cj-card-hero > * { position: relative; z-index: 1; }
.cj-card-hero .muted { color: #b2c5b8; }
.cj-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.cj-grid { display: grid; gap: 1rem; }
@media (min-width: 900px) { .cj-grid.side { grid-template-columns: 1fr 340px; align-items: start; } .cj-sticky { position: sticky; top: 80px; } }
.cj-list { list-style: none; margin: 0; padding: 0; }
.cj-job { display: flex; gap: .9rem; align-items: center; padding: 1rem; border-radius: 16px; border: 1px solid var(--line); background: #fff; text-decoration: none; color: var(--ink);
  margin-bottom: .6rem; transition: transform .25s var(--ease), border-color .25s, box-shadow .25s; }
.cj-job:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--a) 50%, var(--line)); box-shadow: var(--shadow); color: var(--ink); }
.cj-job-ico { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--a-soft); color: var(--a-deep); font-weight: 800; }
.cj-job b { display: block; } .cj-job small { color: var(--soft); }
.cj-job .go { margin-left: auto; color: var(--faint); font-size: 1.2rem; }
.cj-empty { text-align: center; padding: 2rem 1rem; color: var(--soft); }
.cj-empty b { display: block; color: var(--ink); font-size: 1.1rem; margin-bottom: .3rem; }

/* status pills */
.pill { display: inline-flex; align-items: center; gap: .35rem; font-size: .74rem; font-weight: 800; padding: .28rem .65rem; border-radius: 999px; background: #eef2ef; color: var(--soft); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-REQUESTED { background: #eef3ff; color: #3451b2; } .pill-SCHEDULED { background: #eaf4ff; color: #0b6bcb; }
.pill-IN_PROGRESS { background: #fff4e0; color: #9a5b00; } .pill-AWAITING_REVIEW { background: var(--a-soft); color: var(--a-deep); }
.pill-ATTENTION { background: #fdecec; color: var(--bad); } .pill-APPROVED, .pill-CLOSED { background: #e7f6ec; color: var(--ok); }
.pill-CANCELLED { background: #f1f1f1; color: #777; }
.pill-DONE, .pill-APPROVED { background: #e7f6ec; color: var(--ok); } .pill-PARTIAL { background: #fff4e0; color: var(--warn); }
.pill-NOT_DONE { background: #fdecec; color: var(--bad); } .pill-PENDING { background: #f1f3f2; color: var(--faint); } .pill-NA { background: #f1f1f1; color: #666; }

/* progress */
.cj-progress { height: 10px; border-radius: 999px; background: #e9efea; overflow: hidden; }
.cj-progress i { display: block; height: 100%; width: var(--p, 0%); background: linear-gradient(90deg, var(--a), color-mix(in srgb, var(--a) 60%, #0a6)); border-radius: inherit; transition: width .8s var(--ease); }
.cj-ring { --p: 0; width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--a) calc(var(--p) * 1%), rgba(255,255,255,.12) 0); }
.cj-ring > div { width: 74px; height: 74px; border-radius: 50%; background: var(--night); display: grid; place-items: center; text-align: center; line-height: 1.05; }
.cj-ring b { font-size: 1.35rem; font-family: "Plus Jakarta Sans"; } .cj-ring small { font-size: .66rem; color: #a9bcae; }
.cj-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; }
@media (min-width: 720px) { .cj-stats { grid-template-columns: repeat(4, 1fr); } }
.cj-stat { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: .9rem 1rem; }
.cj-stat b { display: block; font-size: 1.6rem; font-family: "Plus Jakarta Sans"; }
.cj-stat span { color: var(--soft); font-size: .82rem; font-weight: 600; }

/* key/value */
.cj-kv { display: grid; grid-template-columns: 130px 1fr; gap: .45rem 1rem; margin: 0; font-size: .94rem; }
.cj-kv dt { color: var(--soft); font-weight: 600; } .cj-kv dd { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
@media (max-width: 480px) { .cj-kv { grid-template-columns: 1fr; } .cj-kv dd { margin-bottom: .5rem; } }

/* tasks + review */
.cj-task { border: 1px solid var(--line); border-radius: 16px; padding: .9rem 1rem; background: #fff; margin-bottom: .6rem; transition: border-color .25s, box-shadow .25s; }
.cj-task.removed { opacity: .5; text-decoration: line-through; }
.cj-task-top { display: flex; gap: .7rem; justify-content: space-between; align-items: flex-start; }
.cj-task-title { font-weight: 700; }
.cj-task-meta { font-size: .8rem; color: var(--faint); margin-top: .15rem; }
.cj-task .why { font-size: .85rem; color: var(--warn); margin-top: .35rem; }
.cj-task.high { border-left: 4px solid var(--warn); }
.cj-statuses { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }
.rv { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; margin-top: .7rem; }
.rv button { border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: .6rem .3rem; font: inherit; font-weight: 700; font-size: .82rem; cursor: pointer; color: var(--soft);
  transition: all .2s var(--ease); }
.rv button:hover { border-color: var(--faint); }
.rv button.on[data-v=APPROVED] { background: #e7f6ec; border-color: var(--ok); color: var(--ok); }
.rv button.on[data-v=ATTENTION] { background: #fdecec; border-color: var(--bad); color: var(--bad); }
.rv button.on[data-v=NA] { background: #f1f1f1; border-color: #888; color: #555; }
.rv-note { margin-top: .5rem; display: none; } .rv-note.show { display: block; animation: cj-in .3s var(--ease); }
.cj-task.saving { opacity: .7; } .cj-task.flash { box-shadow: 0 0 0 3px color-mix(in srgb, var(--a) 40%, transparent); }

/* photos */
.ph-area { margin-bottom: 1.1rem; }
.ph-area h3 { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.ph-pair { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.ph-col > span { display: block; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--soft); margin-bottom: .35rem; }
.ph-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: .4rem; }
.ph { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 1; background: #e6ece7; border: 0; padding: 0; cursor: zoom-in; display: block; }
.ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.ph:hover img { transform: scale(1.05); }
.ph .stamp { position: absolute; left: 0; right: 0; bottom: 0; font-size: .6rem; color: #fff; padding: .25rem .35rem; background: linear-gradient(transparent, rgba(0,0,0,.7)); text-align: left; }
.ph.pending::after { content: "Waiting to upload"; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(6,18,10,.55); color: #fff; font-size: .7rem; font-weight: 700; text-align: center; padding: .3rem; }
.ph-none { display: grid; place-items: center; aspect-ratio: 1; border-radius: 12px; border: 1.5px dashed var(--line); color: var(--faint); font-size: .78rem; text-align: center; padding: .4rem; }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(4,10,6,.92); display: none; align-items: center; justify-content: center; padding: 16px; }
.lightbox.open { display: flex; animation: cj-fade .2s; }
.lightbox img { max-height: 84vh; max-width: 100%; border-radius: 14px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.lightbox p { position: absolute; bottom: 16px; left: 16px; right: 16px; color: #dfe9e2; text-align: center; font-size: .85rem; }
.lightbox button { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 1.3rem; cursor: pointer; }

/* signature */
.sig { position: relative; border: 2px dashed var(--line); border-radius: 16px; background: #fff; touch-action: none; }
.sig canvas { width: 100%; height: 180px; display: block; cursor: crosshair; }
.sig .hint { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); pointer-events: none; font-weight: 600; }
.sig.has .hint { display: none; }
.sig-clear { position: absolute; top: 8px; right: 8px; }

/* timeline */
.cj-tl { list-style: none; margin: 0; padding: 0 0 0 1.1rem; border-left: 2px solid var(--line); }
.cj-tl li { position: relative; padding: 0 0 .9rem .9rem; font-size: .88rem; }
.cj-tl li::before { content: ""; position: absolute; left: -1.55rem; top: .3rem; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--a); }
.cj-tl time { display: block; font-size: .74rem; color: var(--faint); font-weight: 600; }

/* toasts */
.cj-toasts { position: relative; z-index: 60; }
.cj-toast { border-radius: 14px; padding: .8rem 1rem; margin-bottom: .8rem; font-weight: 600; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); animation: cj-in .4s var(--ease); }
.cj-toast-success { border-color: color-mix(in srgb, var(--a) 60%, #fff); background: var(--a-soft); color: var(--a-deep); }
.cj-toast-error { border-color: #f3c7c7; background: #fdecec; color: var(--bad); }
.cj-alert { border-radius: 14px; padding: .8rem 1rem; margin-bottom: 1rem; font-weight: 600; background: #fdecec; color: var(--bad); border: 1px solid #f3c7c7; }
.cj-note { border-radius: 14px; padding: .8rem 1rem; margin-bottom: 1rem; background: var(--a-soft); color: var(--a-deep); font-size: .92rem; }
.cj-warnbox { border-radius: 14px; padding: .8rem 1rem; margin-bottom: 1rem; background: #fff6e5; color: #7a4a00; font-size: .92rem; border: 1px solid #f6dca6; }

/* auth screens */
.cj-auth { max-width: 440px; margin: 2rem auto; }
.cj-auth .cj-card { padding: 1.6rem; }
.cj-auth-hero { text-align: center; margin-bottom: 1.2rem; }
.cj-auth-hero .cj-mark { width: 54px; height: 54px; border-radius: 18px; margin: 0 auto 1rem; display: block; }
.hp { position: absolute; left: -5000px; }

/* staff */
.cj-staff { background: radial-gradient(800px 380px at 100% -5%, color-mix(in srgb, var(--a) 18%, transparent), transparent 70%), #eef3ef; }
.st-step { display: flex; align-items: center; gap: .7rem; margin: 1.4rem 0 .7rem; }
.st-step .num { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--night); color: #fff; font-weight: 800; flex: none; }
.st-step.done .num { background: var(--a); color: var(--a-ink); }
.st-step h2 { margin: 0; }
.st-area { display: flex; align-items: center; gap: .7rem; padding: .75rem .8rem; border: 1px solid var(--line); background: #fff; border-radius: 16px; margin-bottom: .5rem; }
.st-area.ok { border-color: color-mix(in srgb, var(--a) 55%, var(--line)); }
.st-area .ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: #f1f4f2; flex: none; font-weight: 800; }
.st-area.ok .ic { background: var(--a); color: var(--a-ink); }
.st-area .t { flex: 1; min-width: 0; } .st-area .t b { display: block; } .st-area .t small { color: var(--soft); }
.st-cam { position: relative; overflow: hidden; }
.st-cam input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.st-thumbs { display: flex; gap: .35rem; overflow-x: auto; padding: .4rem 0 0; }
.st-thumbs .ph { width: 64px; flex: none; }
.st-task-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; margin-top: .65rem; }
.st-task-btns button { border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: .7rem .2rem; font: inherit; font-weight: 700; font-size: .8rem; cursor: pointer; color: var(--soft); }
.st-task-btns button.on[data-v=DONE] { background: #e7f6ec; border-color: var(--ok); color: var(--ok); }
.st-task-btns button.on[data-v=PARTIAL] { background: #fff4e0; border-color: var(--warn); color: var(--warn); }
.st-task-btns button.on[data-v=NOT_DONE] { background: #fdecec; border-color: var(--bad); color: var(--bad); }
.st-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: .7rem 16px calc(.7rem + env(safe-area-inset-bottom)); background: rgba(6,18,10,.94); backdrop-filter: blur(12px); }
.st-bar .cj-wrap { padding: 0; display: flex; gap: .6rem; align-items: center; }
.st-bar .info { flex: 1; color: #cfe0d4; font-size: .8rem; line-height: 1.3; }
.st-queue { font-size: .8rem; color: var(--soft); }
.st-hero { display: flex; gap: 1rem; align-items: center; }
.st-modal { position: fixed; inset: 0; z-index: 90; background: rgba(4,10,6,.6); display: none; align-items: flex-end; justify-content: center; }
.st-modal.open { display: flex; animation: cj-fade .2s; }
.st-sheet { background: #fff; width: 100%; max-width: 560px; border-radius: 24px 24px 0 0; padding: 1.2rem 16px calc(1.2rem + env(safe-area-inset-bottom)); animation: cj-up .3s var(--ease); max-height: 90vh; overflow: auto; }

@keyframes cj-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes cj-fade { from { opacity: 0; } }
@keyframes cj-up { from { transform: translateY(40px); opacity: .6; } }
.js .cj-rise { animation: cj-in .5s var(--ease) both; }
.js .cj-rise:nth-child(2) { animation-delay: .05s; } .js .cj-rise:nth-child(3) { animation-delay: .1s; } .js .cj-rise:nth-child(4) { animation-delay: .15s; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
