/* GCleanUSA Field — design system (black / charcoal / yellow / white) */
:root {
  --bg: #070707;
  --bg-elev: #101010;
  --bg2: #161616;
  --bg3: #1e1e1e;
  --glass: rgba(22, 22, 22, 0.78);
  --yellow: #F5C518;
  --yellow-dim: #C9A012;
  --yellow-soft: rgba(245, 197, 24, 0.14);
  --text: #F5F5F5;
  --muted: #9CA3AF;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --danger: #EF4444;
  --ok: #22C55E;
  --warn: #F59E0B;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-lg: 22px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 4px 18px rgba(0, 0, 0, 0.35);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-h: 72px;
  --sidebar-w: 248px;
  --header-h: 64px;
  --font: "Outfit", "Segoe UI", system-ui, sans-serif;
  font-family: var(--font);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; min-height: 100%;
  background: var(--bg); color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
body {
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(245, 197, 24, 0.08), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(255, 255, 255, 0.03), transparent 50%),
    var(--bg);
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--yellow); }
img { max-width: 100%; }

/* ── Layout shell ─────────────────────────────────── */
.app-frame {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
}
.sidebar {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 20px 14px;
  background: linear-gradient(180deg, #0c0c0c 0%, #080808 100%);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-brand {
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--yellow);
  font-size: 0.92rem;
  padding: 8px 12px 4px;
}
.sidebar-brand span { color: var(--text); font-weight: 600; }
.sidebar-user {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0 12px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--muted);
  padding: 12px 14px; border-radius: 14px;
  font-weight: 600; font-size: 0.92rem;
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-nav a:hover { background: var(--bg3); color: var(--text); }
.sidebar-nav a.active {
  background: var(--yellow-soft);
  color: var(--yellow);
  box-shadow: inset 0 0 0 1px rgba(245, 197, 24, 0.25);
}
.sidebar-cta {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}
.sidebar-cta .btn {
  display: flex;
  width: 100%;
  text-decoration: none;
  position: relative;
  z-index: 1;
}


.app-main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.app-header {
  position: sticky; top: 0; z-index: 25;
  display: flex; align-items: center; gap: 12px;
  min-height: var(--header-h);
  padding: 10px 16px;
  padding-top: calc(10px + var(--safe-top));
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.app-header .brand-mobile {
  font-weight: 800; letter-spacing: 0.04em; color: var(--yellow); font-size: 0.85rem; white-space: nowrap;
}
.app-header .brand-mobile span { color: var(--text); font-weight: 600; }
.header-search {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 8px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
}
.header-search input {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none;
  color: var(--text); font-size: 0.92rem;
}
.header-search svg { flex-shrink: 0; opacity: 0.55; }
.sync-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.72rem; font-weight: 700;
  padding: 6px 10px; border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg2); color: var(--muted); white-space: nowrap;
}
.sync-chip.ok { color: #86efac; border-color: rgba(34, 197, 94, 0.35); background: rgba(5, 46, 22, 0.45); }
.sync-chip.warn { color: #fcd34d; border-color: rgba(245, 197, 24, 0.35); background: var(--yellow-soft); }
.sync-chip.off { color: #fca5a5; border-color: rgba(239, 68, 68, 0.35); background: rgba(69, 10, 10, 0.4); }
.sync-dot {
  width: 7px; height: 7px; border-radius: 50%; background: currentColor;
}
.header-user { display: none; color: var(--muted); font-size: 0.85rem; font-weight: 600; white-space: nowrap; }

.app-content {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 16px calc(var(--nav-h) + 20px + var(--safe-bottom));
}

/* ── Bottom nav (mobile) ──────────────────────────── */
.bottom-nav {
  position: fixed; left: 12px; right: 12px; bottom: calc(10px + var(--safe-bottom));
  z-index: 40;
  display: grid; grid-template-columns: repeat(5, 1fr);
  align-items: end;
  gap: 2px;
  padding: 8px 6px 10px;
  background: rgba(18, 18, 18, 0.92);
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.bottom-nav a {
  text-decoration: none; color: var(--muted);
  text-align: center; font-size: 0.62rem; font-weight: 700;
  padding: 4px 2px; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.bottom-nav a.active { color: var(--yellow); }
.bottom-nav .nav-fab {
  width: 54px; height: 54px; margin: -22px auto 0;
  border-radius: 50%; border: 0;
  background: var(--yellow); color: #111;
  display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(245, 197, 24, 0.35);
  text-decoration: none;
}
.bottom-nav .nav-fab.active { outline: 2px solid #fff; outline-offset: 2px; }
.bottom-nav .nav-fab svg { width: 26px; height: 26px; }

.ico-svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-nav .ico-svg { width: 20px; height: 20px; }

/* ── Components ───────────────────────────────────── */
.panel { padding: 0; }
.hero-greet {
  margin: 4px 0 18px;
  padding: 20px 18px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(245, 197, 24, 0.16) 0%, rgba(245, 197, 24, 0.02) 45%, transparent 70%),
    linear-gradient(180deg, #1a1a1a 0%, #121212 100%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}
.hero-greet h1 {
  margin: 0 0 6px; font-size: 1.55rem; font-weight: 800; letter-spacing: -0.02em;
}
.hero-greet p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.today-card {
  margin: 0 0 12px;
  padding: 18px 16px 16px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(245, 197, 24, 0.18) 0%, rgba(245, 197, 24, 0.04) 42%, transparent 72%),
    linear-gradient(180deg, #1c1c1c 0%, #121212 100%);
  border: 1px solid rgba(245, 197, 24, 0.28);
  box-shadow: var(--shadow-soft);
}
.today-card-next { padding-top: 14px; }
.today-kicker {
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--yellow);
}
.today-card h2 { margin: 6px 0 4px; font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; }
.today-address { margin: 0; font-size: 1rem; line-height: 1.35; }
.today-meta { margin: 6px 0 14px; color: var(--muted); font-size: 0.85rem; }
.today-actions { display: flex; flex-direction: column; gap: 8px; }
.today-actions .ico-svg { width: 22px; height: 22px; }
.today-actions-row { flex-direction: row; }
.today-actions-row .btn { flex: 1; min-height: 48px; }

.queue-banner {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 14px; padding: 14px 16px;
  text-decoration: none; color: #111;
  background: var(--yellow); border-radius: var(--radius);
  font-weight: 800;
}
.queue-banner .ico-svg { width: 22px; height: 22px; flex-shrink: 0; }
.queue-banner strong { display: block; font-size: 1rem; }
.queue-hint { display: block; margin-top: 2px; font-size: 0.8rem; font-weight: 600; opacity: 0.72; }

.metrics.metrics-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 420px;
  gap: 8px;
}
.metrics.metrics-compact .metric { padding: 10px 12px; }
.metrics.metrics-compact .value { font-size: 1.15rem; margin-top: 2px; }

.section-links { display: flex; align-items: center; gap: 14px; }
.grid-photos { scroll-margin-top: 72px; }

.metrics {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin-bottom: 18px;
}
.metric {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 12px;
  box-shadow: var(--shadow-soft);
}
.metric .label {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.08em;
  color: var(--muted); text-transform: uppercase;
}
.metric .value {
  margin-top: 6px; font-size: 1.45rem; font-weight: 800; letter-spacing: -0.03em;
  color: var(--text);
}
.metric .hint { margin-top: 4px; font-size: 0.72rem; color: var(--muted); }

.quick-actions {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin-bottom: 22px;
}
.quick-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; color: var(--text);
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 8px; min-height: 92px;
  font-weight: 700; font-size: 0.78rem; text-align: center;
  transition: border-color 0.15s ease, transform 0.15s ease;
  cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  appearance: none; width: 100%; box-sizing: border-box;
}
.new-job-card { border-color: rgba(245, 197, 24, 0.35); }
.new-job-card .field { margin-bottom: 10px; }
.quick-card:active { transform: scale(0.98); }
.quick-card.primary {
  background: var(--yellow-soft);
  border-color: rgba(245, 197, 24, 0.35);
  color: var(--yellow);
}
.quick-card .ico-svg { width: 26px; height: 26px; }

.section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 8px 0 12px;
}
.section-head h2, .section-title {
  margin: 0; font-size: 1.05rem; font-weight: 800; letter-spacing: -0.01em;
}
.section-title { margin: 22px 0 10px; }

.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-soft);
}
.note-card { position: relative; padding-right: 36px; }
.note-del, .thumb-del {
  position: absolute; top: 6px; right: 6px; z-index: 3;
  width: 32px; height: 32px; border: 0; border-radius: 999px;
  background: rgba(0, 0, 0, 0.72); color: #fff;
  font-size: 1.35rem; font-weight: 900; line-height: 1;
  cursor: pointer; padding: 0; display: grid; place-items: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.45);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.note-del:active, .thumb-del:active { opacity: 0.7; background: rgba(127, 29, 29, 0.9); }
.thumb-check {
  position: absolute; top: 6px; right: 6px; z-index: 3;
  width: 28px; height: 28px; border-radius: 8px;
  border: 2px solid rgba(255,255,255,0.95);
  background: rgba(0,0,0,0.45); color: #111;
  font-size: 0.95rem; font-weight: 900; line-height: 1;
  display: grid; place-items: center; padding: 0; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.thumb-check.on {
  background: var(--yellow); border-color: var(--yellow); color: #111;
}
.thumb-selected { outline: 2px solid var(--yellow); outline-offset: -2px; }
.thumb-selectable { cursor: pointer; }
.photo-bulk-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0 0 12px; padding: 10px 12px;
  background: var(--bg3); border: 1px solid var(--border); border-radius: 12px;
}
.photo-bulk-bar .meta { flex: 1; min-width: 110px; margin: 0; }
.card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.meta { color: var(--muted); font-size: 0.85rem; line-height: 1.45; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.btn {
  appearance: none; border: 0; border-radius: 14px; padding: 14px 16px;
  font-weight: 700; cursor: pointer; min-height: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; color: inherit; box-sizing: border-box;
  transition: transform 0.12s ease, opacity 0.12s ease, background 0.12s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--yellow); color: #111; }
.btn-primary:active { background: var(--yellow-dim); }
.btn-ghost { background: var(--bg3); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: #3f1212; color: #fecaca; border: 1px solid #7f1d1d; }
.btn-block { width: 100%; display: flex; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-xl { min-height: 56px; font-size: 1.05rem; padding: 16px 18px; }
.btn-sm { min-height: 40px; padding: 8px 12px; font-size: 0.85rem; border-radius: 12px; }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; background: #0c0c0c; color: var(--text);
  border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; min-height: 48px;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: rgba(245, 197, 24, 0.55);
  box-shadow: 0 0 0 3px rgba(245, 197, 24, 0.12);
}

.advisor-hero { border-color: rgba(245, 197, 24, 0.22); }
.advisor-status { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.advisor-missing { margin: 0 0 14px; padding-left: 18px; color: var(--warn); font-size: 0.85rem; line-height: 1.45; }
.advisor-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.adv-chip {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border); background: var(--bg2); color: var(--muted);
  border-radius: 999px; padding: 10px 14px; font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.adv-chip input { accent-color: var(--yellow); width: 16px; height: 16px; }
.adv-chip.on {
  background: var(--yellow-soft); color: var(--yellow);
  border-color: rgba(245, 197, 24, 0.45);
}
.advisor-range { border-color: rgba(245, 197, 24, 0.45); }
.advisor-price { font-size: 1.45rem; font-weight: 800; margin: 6px 0; letter-spacing: -0.02em; }
.advisor-vision { border-color: rgba(34, 197, 94, 0.35); }
.advisor-ai-ok { border-color: rgba(34, 197, 94, 0.35); }
.advisor-rules-only { border-color: rgba(245, 197, 24, 0.45); }
.field.ai-suggested {
  border: 1px dashed rgba(56, 189, 248, 0.55);
  border-radius: 10px;
  padding: 10px;
  background: rgba(56, 189, 248, 0.06);
}
.ai-suggest-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #7dd3fc;
  margin-bottom: 6px;
}
.badge-ai {
  background: rgba(56, 189, 248, 0.18);
  color: #bae6fd;
}
#adv-autosave-hint { min-height: 1.2em; }

.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; }
.filter-chip {
  flex: 0 0 auto; border: 1px solid var(--border); background: var(--bg2);
  color: var(--muted); border-radius: 999px; padding: 8px 14px;
  font-weight: 700; font-size: 0.8rem; cursor: pointer;
}
.filter-chip.active {
  background: var(--yellow-soft); color: var(--yellow);
  border-color: rgba(245, 197, 24, 0.4);
}

/* Job tiles */
.job-tile {
  display: grid; grid-template-columns: 88px 1fr; gap: 12px;
  text-decoration: none; color: inherit;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px; margin-bottom: 0;
  box-shadow: var(--shadow-soft);
  transition: border-color 0.15s ease;
}
.job-wrap {
  position: relative;
  margin-bottom: 12px;
}
.job-wrap .job-tile { margin-bottom: 0; }
.job-del {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  width: 32px; height: 32px; border: 0; background: transparent;
  color: #fff; font-size: 1.45rem; font-weight: 900; line-height: 1;
  cursor: pointer; padding: 0; display: grid; place-items: center;
  text-shadow: 0 1px 2px rgba(0,0,0,0.85), 0 0 6px rgba(0,0,0,0.55);
}
.job-del:active { opacity: 0.7; }
.job-tile-body { padding-right: 28px; }

.job-tile:active { border-color: rgba(245, 197, 24, 0.35); }
.job-cover {
  width: 88px; height: 88px; border-radius: 12px; overflow: hidden;
  background: linear-gradient(145deg, #222, #111);
  border: 1px solid var(--border);
  display: grid; place-items: center; color: var(--muted); font-weight: 800;
}
.job-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.job-tile-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 2px 0; }
.job-tile-body h3 { margin: 0; font-size: 1rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-tile-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.job-tile-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.job-price-pill {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
  white-space: nowrap;
  line-height: 1.1;
}
.job-price-pill.draft {
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.job-menu { display: flex; justify-content: flex-end; position: relative; margin: 8px 0 4px; }
.job-menu-panel {
  position: absolute; top: 44px; right: 0; z-index: 6;
  background: #1a1a1a; border: 1px solid var(--border-strong);
  border-radius: 12px; padding: 6px; min-width: 220px;
  box-shadow: var(--shadow);
}
.job-menu-panel button {
  width: 100%; text-align: left; background: transparent; color: #fecaca;
  border: 0; padding: 12px; font-weight: 700; cursor: pointer; border-radius: 8px;
}
.trash-row { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }

.swipe-row {
  position: relative; margin-bottom: 12px; border-radius: var(--radius); overflow: hidden;
}
.swipe-row .job-tile { margin-bottom: 0; }
.swipe-bg {
  position: absolute; inset: 0; display: flex; align-items: center;
  padding: 0 18px; font-weight: 800; font-size: 0.9rem;
}
.swipe-bg-left { justify-content: flex-end; background: #14532d; color: #bbf7d0; }
.swipe-bg-right { justify-content: flex-start; background: #7f1d1d; color: #fecaca; }
.swipe-front {
  position: relative; z-index: 1; background: transparent;
  cursor: pointer; touch-action: pan-y;
}

.badge {
  display: inline-block; font-size: 0.68rem; font-weight: 800; padding: 4px 8px; border-radius: 999px;
  background: var(--yellow-soft); color: var(--yellow); text-transform: uppercase; letter-spacing: 0.04em;
}
.badge-ok { background: #052e16; color: #86efac; }
.badge-warn { background: #422006; color: #fcd34d; }
.badge-err { background: #450a0a; color: #fca5a5; }

.job-hero {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  margin-bottom: 16px; border: 1px solid var(--border); min-height: 160px;
  background: #111;
}
.job-hero img {
  width: 100%; height: 180px; object-fit: cover; display: block;
  filter: brightness(0.72);
}
.job-hero-fallback {
  height: 160px;
  background: linear-gradient(135deg, #2a2408, #121212 55%);
}
.job-hero-overlay {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 16px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
}
.job-hero-overlay h2 { margin: 0 0 4px; font-size: 1.35rem; font-weight: 800; }
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.85rem;
  margin-bottom: 10px;
}
.back-link:hover { color: var(--yellow); }

.seg-tabs {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  margin-bottom: 14px; padding: 4px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 14px;
}
.seg-tabs button {
  border: 0; background: transparent; color: var(--muted);
  font-weight: 700; font-size: 0.78rem; padding: 10px 6px;
  border-radius: 10px; cursor: pointer;
}
.seg-tabs button.active {
  background: var(--yellow-soft); color: var(--yellow);
}

.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tab {
  flex: 1; text-align: center; padding: 12px 8px; border-radius: 12px;
  background: var(--bg3); color: var(--muted); font-weight: 700;
  border: 1px solid transparent; cursor: pointer;
}
.tab.active { background: var(--yellow-soft); color: var(--yellow); border-color: rgba(245, 197, 24, 0.35); }

.grid-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.thumb {
  aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #000;
  border: 1px solid var(--border); position: relative; cursor: pointer;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pending-thumb {
  opacity: 0.9; border-color: var(--warn) !important;
  display: flex; align-items: center; justify-content: center;
  background: #1a1408;
}
.pending-label { text-align: center; font-size: 0.7rem; font-weight: 700; color: #fcd34d; line-height: 1.3; }

.photo-actions { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 16px; }
.album-hint { color: var(--yellow); font-size: 0.88rem; margin: 0 0 12px; font-weight: 600; }

.empty, .empty-hero {
  text-align: center; color: var(--muted); padding: 28px 16px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  background: rgba(255,255,255,0.02);
}
.empty-hero { text-align: left; }
.empty-hero h3 { color: var(--text); }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + 24px + var(--safe-bottom));
  background: #1a1a1a; border: 1px solid var(--border-strong); color: var(--text);
  padding: 12px 16px; border-radius: 14px; z-index: 60; max-width: 90%;
  font-size: 0.9rem; font-weight: 600; box-shadow: var(--shadow);
}
.hidden { display: none !important; }

.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background:
    radial-gradient(ellipse at top, rgba(245, 197, 24, 0.12) 0%, transparent 50%),
    linear-gradient(180deg, #111 0%, #070707 100%);
}
.login-card {
  width: 100%; max-width: 400px;
  background: var(--glass); border: 1px solid var(--border-strong);
  border-radius: 24px; padding: 28px 22px;
  box-shadow: var(--shadow); backdrop-filter: blur(18px);
}
.login-logo { color: var(--yellow); font-size: 1.55rem; font-weight: 900; letter-spacing: 0.06em; }
.login-sub { color: var(--muted); margin: 6px 0 22px; }
.login-card .field input {
  background: #2a2a2a;
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #f4f4f4;
}
.login-card .field label { color: #d6d6d6; }

.checkline { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.9rem; margin: 8px 0 16px; }
.checkline input { width: 20px; height: 20px; }
.login-card .checkline {
  width: 100%;
  min-height: 28px;
  margin: 2px 0 16px;
  color: #d4d4d4;
}
.login-card .checkline input {
  width: 20px; height: 20px; margin: 0; flex: 0 0 20px;
  accent-color: var(--yellow);
}

.voice-panel { margin-top: 14px; }
.voice-rec-ui { margin-top: 10px; }
.rec-live {
  display: flex; align-items: center; gap: 10px;
  color: #fca5a5; font-weight: 700; margin-bottom: 12px;
}
.rec-dot {
  width: 12px; height: 12px; border-radius: 50%; background: #ef4444;
  animation: recpulse 1.2s infinite;
}
@keyframes recpulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55); }
  70% { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
@keyframes fadeup {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.app-content > * { animation: fadeup 0.28s ease both; }

.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,0.94); z-index: 80;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 12px 8px calc(12px + var(--safe-bottom));
  touch-action: pan-y;
}
.lightbox.hidden { display: none !important; }
.lb-stage {
  position: relative; flex: 1; width: 100%; max-width: 920px;
  display: flex; align-items: center; justify-content: center; min-height: 0;
}
.lightbox img#lb-img {
  max-width: 100%; max-height: min(72vh, 820px);
  border-radius: 8px; object-fit: contain;
  transition: transform 0.2s ease, opacity 0.15s ease;
  user-select: none; -webkit-user-select: none;
}
.lb-counter {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.65); color: #fff; font-weight: 700;
  font-size: 0.85rem; padding: 6px 12px; border-radius: 999px; z-index: 2;
}
.lb-nav {
  position: absolute; top: 42%; transform: translateY(-50%);
  width: 48px; height: 64px; border: 0; border-radius: 12px;
  background: rgba(245, 197, 24, 0.92); color: #111;
  font-size: 2rem; font-weight: 800; line-height: 1; cursor: pointer; z-index: 3;
}
.lb-prev { left: 8px; }
.lb-next { right: 8px; }
.lb-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.lb-hint { color: var(--muted); font-size: 0.78rem; margin-top: 8px; text-align: center; }
.lightbox .actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.invoice-frame {
  width: 100%; height: min(72vh, 820px); border: 0; border-radius: 8px; background: #fff;
}

.progress-bar {
  height: 6px; border-radius: 999px; background: #2a2a2a; overflow: hidden; margin-top: 10px;
}
.progress-bar > span {
  display: block; height: 100%; width: 40%;
  background: linear-gradient(90deg, var(--yellow-dim), var(--yellow));
  animation: indeterminate 1.1s ease infinite;
}
@keyframes indeterminate {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(280%); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Desktop */
@media (min-width: 900px) {
  .app-frame { grid-template-columns: var(--sidebar-w) 1fr; }
  .sidebar { display: flex; }
  .bottom-nav { display: none; }
  .app-header .brand-mobile { display: none; }
  .header-user { display: block; }
  .app-content {
    padding: 24px 28px 40px;
    max-width: 1200px;
  }
  .metrics { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .quick-actions { grid-template-columns: repeat(3, 1fr); max-width: 560px; }
  .job-tile { grid-template-columns: 112px 1fr; }
  .job-cover { width: 112px; height: 112px; }
  .grid-photos { grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .photo-actions { flex-direction: row; }
  .photo-actions .btn { flex: 1; }
}

@media (max-width: 480px) {
  .metrics { gap: 8px; }
  .metric { padding: 12px 10px; }
  .metric .value { font-size: 1.25rem; }
  .quick-card { font-size: 0.72rem; min-height: 84px; }
  .seg-tabs button { font-size: 0.7rem; padding: 10px 2px; }
}
