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

:root {
  --bg: #f8f9fc;
  --surface: #ffffff;
  --surface-2: #f1f3f9;
  --border: #e4e7f0;
  --text: #1a1d2e;
  --text-2: #5a5f7a;
  --text-3: #9498b0;
  --accent: #4f46e5;
  --accent-light: #eef2ff;
  --red: #e11d48;
  --red-light: #fff1f3;
  --green: #059669;
  --orange: #ea580c;
  --blue: #2563eb;
  --radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--bg); color: var(--text);
  line-height: 1.6; max-width: 480px; margin: 0 auto;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

/* TOP BAR */
.topbar {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 20px; position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.9); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-icon { font-size: 1rem; }
.topbar-text { font-size: .78rem; font-weight: 700; color: var(--text-2); letter-spacing: .3px; }

/* HERO CARD */
.hero-card {
  padding: 28px 20px 24px; text-align: center;
  background: linear-gradient(180deg, #eef2ff 0%, var(--bg) 100%);
}
.hero-label {
  font-size: .62rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--accent); margin-bottom: 8px;
}
.hero-card h1 {
  font-size: 1.7rem; font-weight: 800; color: var(--text);
  letter-spacing: -0.5px; margin-bottom: 6px;
}
.hero-loc { font-size: .78rem; color: var(--text-2); margin-bottom: 16px; }
.hero-tags { display: flex; gap: 8px; justify-content: center; }
.tag {
  font-size: .66rem; font-weight: 700; padding: 5px 12px;
  border-radius: 50px;
}
.tag-red { background: var(--red-light); color: var(--red); border: 1px solid rgba(225,29,72,.15); }
.tag-neutral { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }

/* MAP */
.map-section {
  margin: 0 16px; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); box-shadow: 0 4px 20px rgba(0,0,0,.06);
}
.map-el { height: 220px; width: 100%; }

/* INFO ROW */
.info-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  margin: 16px 16px 0; background: var(--border); border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--border);
}
.info-box { text-align: center; padding: 14px 8px; background: var(--surface); }
.info-val { font-size: 1.05rem; font-weight: 800; color: var(--text); }
.info-lbl { font-size: .6rem; color: var(--text-3); font-weight: 600; margin-top: 2px; text-transform: uppercase; letter-spacing: .5px; }

/* CONTENT CARDS */
.content-card {
  margin: 12px 16px; padding: 18px;
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border);
}
.content-card h2 {
  font-size: .88rem; font-weight: 700; color: var(--text);
  margin-bottom: 10px;
}
.content-card p { font-size: .82rem; color: var(--text-2); line-height: 1.7; margin-bottom: 8px; }
.content-card p:last-child { margin-bottom: 0; }
.content-card strong { color: var(--text); }

/* LIST ITEMS */
.list-items { display: flex; flex-direction: column; gap: 10px; }
.list-item {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: .8rem; color: var(--text-2); line-height: 1.5;
}
.li-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }

/* REQUEST LIST */
.req-list { padding-left: 18px; margin-top: 8px; }
.req-list li {
  font-size: .8rem; color: var(--text-2); margin-bottom: 8px; line-height: 1.6;
}
.req-list li::marker { color: var(--accent); font-weight: 700; }

/* PHOTO ROW */
.photo-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo-box {
  aspect-ratio: 1; background: var(--surface-2); border: 2px dashed var(--border);
  border-radius: 10px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  color: var(--text-3); font-size: 1.4rem;
}
.photo-box small { font-size: .6rem; }

/* TECH GRID */
.tech-grid { display: flex; flex-direction: column; gap: 6px; }
.tech-item {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
  font-size: .78rem;
}
.tech-item:last-child { border-bottom: none; padding-bottom: 0; }
.tech-item strong { color: var(--text-3); font-weight: 600; font-size: .7rem; text-transform: uppercase; letter-spacing: .3px; flex-shrink: 0; max-width: 40%; }
.tech-item span { color: var(--text); font-weight: 600; text-align: right; }

/* PHOTO EVIDENCE */
.doc-caption { font-size: .76rem; color: var(--text-3); margin-bottom: 12px; font-style: italic; }
.photo-evidence { display: flex; flex-direction: column; gap: 10px; }
.photo-evidence img {
  width: 100%; border-radius: 10px; object-fit: cover;
  border: 1px solid var(--border); box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.photo-box.photo-real { border: 1px solid var(--border); padding: 0; }
.photo-box.photo-real img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.doc-caption { font-size: .75rem; color: var(--text-3); margin-bottom: 10px; font-style: italic; }

/* SIGN OFF */
.sign-off { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--border); text-align: center; }
.sign-label { font-size: .78rem; color: var(--text-3); margin-bottom: 20px; }
.sign-name { font-size: .88rem; font-weight: 700; color: var(--text); }
.sign-loc { font-size: .72rem; color: var(--text-3); margin-top: 2px; }

/* FOOTER */
.footer-bar {
  text-align: center; padding: 24px 20px 32px;
  border-top: 1px solid var(--border); margin-top: 12px;
}
.footer-bar p { font-size: .72rem; color: var(--text-3); margin-bottom: 4px; }
.footer-bar a { color: var(--accent); text-decoration: none; font-weight: 600; }
.footer-copy { font-size: .62rem; color: var(--text-3); opacity: .6; }

/* STATUS (kept for when enabled later) */
.tl-loading { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 24px; color: var(--text-3); font-size: .8rem; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.status-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-top: 8px; }
.status-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.status-eyebrow { font-size: .6rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 3px; }
.status-title { font-size: .9rem; font-weight: 800; color: var(--text); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.status-title.st-assigned { color: var(--blue); }
.status-title.st-processed { color: var(--orange); }
.status-title.st-handled { color: var(--green); }
.status-inline { display: inline-flex; align-items: center; gap: 6px; }
.status-bar { display: inline-block; width: 60px; height: 5px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.status-bar-fill { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--accent), var(--green)); }
.status-pct-num { font-size: .68rem; font-weight: 800; color: var(--text-2); }
.status-days { font-size: .62rem; color: var(--text-3); border-left: 1px solid var(--border); padding-left: 6px; }
.status-pill { font-size: .65rem; font-weight: 700; color: var(--accent); background: var(--accent-light); border: 1px solid rgba(79,70,229,.15); border-radius: 50px; padding: 3px 8px; }
.status-pill.high { color: var(--red); background: var(--red-light); border-color: rgba(225,29,72,.15); }
.status-refresh { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-3); transition: all .2s; flex-shrink: 0; }
.status-refresh:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.status-refresh.spinning svg { animation: spin .8s linear infinite; }
.status-card.refreshing { position: relative; pointer-events: none; }
.status-card.refreshing > *:not(.status-overlay) { filter: blur(2px); opacity: .4; }
.status-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 2; border-radius: 12px; background: rgba(255,255,255,.7); backdrop-filter: blur(3px); }
.status-overlay .so-spinner { width: 24px; height: 24px; border: 2.5px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.status-kv { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.status-kv strong { display: block; font-size: .58rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 2px; }
.status-kv span { font-size: .76rem; color: var(--text); font-weight: 700; }
.assign-box { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.assign-title { font-size: .72rem; font-weight: 700; color: var(--text-2); margin-bottom: 8px; }
.assign-title strong { color: var(--text); }
.assign-list { display: flex; flex-direction: column; gap: 8px; }
.assign-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px; }
.assign-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.assign-name { font-size: .72rem; font-weight: 700; color: var(--text); }
.assign-badge { font-size: .62rem; font-weight: 700; border-radius: 50px; padding: 2px 7px; }
.assign-badge.assigned { color: var(--blue); background: #eff6ff; border: 1px solid #bfdbfe; }
.assign-badge.processed { color: var(--orange); background: #fff7ed; border: 1px solid #fed7aa; }
.assign-badge.handled { color: var(--green); background: #ecfdf5; border: 1px solid #a7f3d0; }
.assign-flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; position: relative; }
.assign-flow::before { content: ''; position: absolute; left: 15%; right: 15%; top: 8px; height: 2px; background: var(--border); border-radius: 2px; }
.assign-step { position: relative; z-index: 1; text-align: center; }
.assign-dot { width: 16px; height: 16px; margin: 0 auto 3px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border); }
@keyframes statusPulse { 0%,100% { box-shadow: 0 0 0 3px rgba(79,70,229,.1); } 50% { box-shadow: 0 0 0 6px rgba(79,70,229,0); } }
.assign-step.assigned.done .assign-dot,.assign-step.assigned.active .assign-dot { background: var(--blue); border-color: var(--blue); }
.assign-step.processed.done .assign-dot,.assign-step.processed.active .assign-dot { background: var(--orange); border-color: var(--orange); }
.assign-step.handled.done .assign-dot,.assign-step.handled.active .assign-dot { background: var(--green); border-color: var(--green); }
.assign-step.assigned.active .assign-dot,.assign-step.processed.active .assign-dot,.assign-step.handled.active .assign-dot { animation: statusPulse 1.8s infinite; }
.assign-label { font-size: .62rem; font-weight: 700; color: var(--text-2); }
.assign-date { font-size: .56rem; color: var(--text-3); margin-top: 1px; }
.mini-log { margin-top: 12px; padding: 10px 0 0 14px; border-top: 1px solid var(--border); position: relative; }
.mini-log::before { content: ''; position: absolute; left: 2px; top: 38px; bottom: 6px; width: 2px; background: linear-gradient(180deg, #c7d2fe, var(--border)); border-radius: 2px; }
.mini-log-title { font-size: .68rem; font-weight: 700; color: var(--text-3); margin-bottom: 6px; }
.mini-log-item { position: relative; display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; }
.mini-log-item + .mini-log-item { border-top: 1px dashed var(--border); }
.mini-log-dot { position: absolute; left: -14px; top: 12px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.mini-log-dot.st-assigned { background: var(--blue); }
.mini-log-dot.st-processed { background: var(--orange); }
.mini-log-dot.st-handled { background: var(--green); }
.mini-log-item:first-of-type .mini-log-dot { animation: statusPulse 1.8s infinite; }
.mini-log-body { flex: 1; }
.mini-log-time { font-size: .62rem; color: var(--text-3); }
.mini-log-status { font-size: .76rem; font-weight: 700; color: var(--text); text-transform: capitalize; }
.mini-log-status.st-assigned { color: var(--blue); }
.mini-log-status.st-processed { color: var(--orange); }
.mini-log-status.st-handled { color: var(--green); }
.mini-log-notes { font-size: .72rem; color: var(--text-2); margin-top: 2px; }
.mini-log-by { font-size: .62rem; color: var(--text-3); margin-top: 1px; }
.mini-log-by strong { color: var(--text-2); font-weight: 600; }
.ticket-line { font-size: .78rem; color: var(--text-3); margin-bottom: 12px; }
.ticket-line strong { color: var(--text); }
.tl-error { padding: 16px; background: var(--red-light); border: 1px solid rgba(225,29,72,.15); border-radius: 10px; color: var(--red); font-size: .8rem; text-align: center; }
