/* ===========================================================================
   Cleaning App — styles. Mobile-first; big tap targets for on-phone use.
   =========================================================================== */

:root {
  --bg:        #f4f5f4;
  --surface:   #ffffff;
  --text:      #1c2421;
  --muted:     #6b756f;
  --border:    #e2e5e3;
  --accent:    #0f766e;
  --accent-dk: #0b5a54;
  --ok:        #15803d;
  --warn:      #b45309;
  --danger:    #b91c1c;
  --radius:    14px;
  --shadow:    0 1px 3px rgba(0, 0, 0, .08), 0 4px 12px rgba(0, 0, 0, .04);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body { overscroll-behavior-y: none; }

/* ── boot / loading ──────────────────────────────────────────────────────── */
.boot {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--muted);
}

/* ── app shell ───────────────────────────────────────────────────────────── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  padding-top: max(14px, env(safe-area-inset-top));
  background: var(--accent);
  color: #fff;
}
.app-header h1 { font-size: 1.05rem; font-weight: 700; }
.app-header .who { font-size: .8rem; opacity: .85; }

.app-main {
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  max-width: 760px;
  margin: 0 auto;
}

/* ── buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 50px;
  padding: 12px 18px;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn.danger { background: var(--danger); }
.btn.ghost { background: transparent; color: #fff; width: auto; min-height: 0; padding: 8px 10px; border: 1px solid rgba(255,255,255,.4); }

/* ── forms ───────────────────────────────────────────────────────────────── */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .85rem; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
.field input {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font: inherit;
  color: var(--text);
}
.field input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

/* ── cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
}

/* ── login screen ────────────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 28px 24px;
}
.login-card .logo {
  width: 56px; height: 56px;
  display: block; margin: 0 auto 12px;
}
.login-card h2 { text-align: center; font-size: 1.2rem; margin-bottom: 4px; }
.login-card .sub { text-align: center; color: var(--muted); font-size: .85rem; margin-bottom: 22px; }

/* ── messages ────────────────────────────────────────────────────────────── */
.msg { font-size: .85rem; padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; }
.msg.error { background: #fdecec; color: var(--danger); }
.msg.info  { background: #eef6f5; color: var(--accent-dk); }

.placeholder { color: var(--muted); text-align: center; padding: 40px 16px; }
.placeholder.small { padding: 16px; font-size: .85rem; }

/* ── bottom tab bar ──────────────────────────────────────────────────────── */
.app-main { padding-bottom: 84px; }
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar .tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 0;
  font-size: .72rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--muted);
}
.tabbar .tab span { font-size: .72rem; }
.tabbar .tab.active { color: var(--accent); font-weight: 700; }

/* ── lists ───────────────────────────────────────────────────────────────── */
.group-h {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  margin: 18px 4px 8px;
}
.group-h:first-child { margin-top: 0; }

.clean-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.cc-unit { font-weight: 700; }
.cc-sub { font-size: .82rem; color: var(--muted); }

/* ── status badges ───────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
}
.s-unassigned { background: #eceeed; color: #6b756f; }
.s-assigned   { background: #fdf2e1; color: #b45309; }
.s-progress   { background: #e4eef7; color: #1d4ed8; }
.s-finished   { background: #e5f3e9; color: #15803d; }
.s-cancelled  { background: #fdecec; color: #b91c1c; }

/* ── clean detail ────────────────────────────────────────────────────────── */
.back {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.detail-head h2, .detail-head h3 { font-size: 1.05rem; }
.times { font-size: .82rem; color: var(--muted); margin: 8px 0 14px; }

.btn + .btn, .card + .btn { margin-top: 4px; }

/* ── checklist ───────────────────────────────────────────────────────────── */
.cl-section {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--accent-dk);
  font-weight: 700;
  margin: 14px 0 4px;
}
.cl-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.cl-item:last-child { border-bottom: none; }
.cl-item input { width: 24px; height: 24px; flex: none; accent-color: var(--accent); }
.cl-item input:checked + span { color: var(--muted); text-decoration: line-through; }

/* ── media ───────────────────────────────────────────────────────────────── */
#media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  margin: 10px 0 14px;
}
.media-tile { position: relative; aspect-ratio: 1; }
.media-tile img, .media-tile video {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 10px;
  background: #000;
}
.media-del {
  position: absolute; top: 4px; right: 4px;
  width: 26px; height: 26px;
  border: none; border-radius: 50%;
  background: rgba(0, 0, 0, .6);
  color: #fff; font-size: .8rem; cursor: pointer;
}
.upload-label { cursor: pointer; }

/* ── notifications ───────────────────────────────────────────────────────── */
.notes { background: #eef6f5; border-color: #cfe4e1; }
.note { margin: 8px 0; }
.note-title { font-weight: 700; font-size: .9rem; }
.note-body { font-size: .84rem; color: var(--muted); }

/* ── video embeds ────────────────────────────────────────────────────────── */
.video-holder:empty { display: none; }
.video-holder iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: 10px;
  margin: 10px 0;
}

/* ── toast ───────────────────────────────────────────────────────────────── */
#toast-host {
  position: fixed;
  left: 0; right: 0; bottom: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  z-index: 50;
}
.toast {
  background: #1c2421;
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: .85rem;
  box-shadow: var(--shadow);
}
.toast.error { background: var(--danger); }
.toast.ok { background: var(--ok); }

/* ── form selects ────────────────────────────────────────────────────────── */
.field select {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font: inherit;
  color: var(--text);
}
.field select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

/* ── admin dashboard stats ───────────────────────────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 6px;
  text-align: center;
}
.stat.warn { background: #fdf2e1; border-color: #f0d9ad; }
.stat-n { font-size: 1.5rem; font-weight: 700; }
.stat-l { font-size: .68rem; color: var(--muted); }

/* ── admin rows / controls ───────────────────────────────────────────────── */
.row-btns {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.row-btns select {
  flex: 1;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font: inherit;
}
.row-btns .btn { width: auto; min-height: 44px; }

.switch {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  color: var(--muted);
  white-space: nowrap;
}
.switch input { width: 20px; height: 20px; accent-color: var(--accent); }

code {
  background: #eceeed;
  padding: 1px 5px;
  border-radius: 5px;
  font-size: .82em;
}

