:root {
  --slate: #1a202c;
  --navy: #2c3e50;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f7fafc;
  --white: #ffffff;
  --accent: #2563eb;
  --accent-2: #38bdf8;
  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
  --radius: 16px;
  --shadow-lg: 0 30px 60px rgba(15, 23, 42, 0.18);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--slate);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }

/* Login layout */
.layout { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }
.rail {
  color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(900px 500px at 80% 0%, rgba(56,189,248,0.20), transparent 55%),
    radial-gradient(700px 500px at 0% 100%, rgba(37,99,235,0.25), transparent 55%),
    var(--slate);
}
.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; font-size: 1.3rem; color: #fff; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; font-weight: 800;
}
.rail-hero { max-width: 26rem; }
.rail-hero .eyebrow {
  display: inline-block; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--accent-2);
  background: rgba(56,189,248,0.10); border: 1px solid rgba(56,189,248,0.25);
  padding: 0.3rem 0.7rem; border-radius: 999px; margin-bottom: 1.25rem;
}
.rail-hero h1 { font-size: 2.1rem; line-height: 1.15; margin-bottom: 1rem; }
.rail-hero p { color: rgba(255,255,255,0.8); }
.rail-points { list-style: none; margin-top: 1.75rem; color: rgba(255,255,255,0.82); }
.rail-points li { margin-bottom: 0.7rem; padding-left: 1.2rem; position: relative; }
.rail-points li::before { content: "✓"; position: absolute; left: 0; color: var(--accent-2); font-weight: 700; }
.rail-foot { font-size: 0.82rem; color: rgba(255,255,255,0.55); }
.panel { display: flex; align-items: center; justify-content: center; padding: 2.5rem 1.5rem; }
.card {
  width: 100%; max-width: 420px; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 2.25rem;
}
.card h2 { font-size: 1.55rem; margin-bottom: 0.35rem; }
.card .sub { color: var(--muted); font-size: 0.95rem; margin-bottom: 1.5rem; }
.badge {
  display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; padding: 0.3rem 0.65rem; border-radius: 999px; margin-bottom: 0.75rem;
}
.badge.beta { color: var(--navy); background: #eef2ff; border: 1px solid #c7d2fe; }
.btn {
  width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-weight: 600; font-size: 1rem; padding: 0.85rem 1rem; border-radius: 10px;
  border: 1px solid transparent; cursor: pointer; transition: background 0.15s ease;
}
.btn-google { background: var(--white); color: var(--slate); border-color: var(--line); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.btn-google:hover { background: #f8fafc; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--line); width: auto; padding: 0.5rem 0.85rem; font-size: 0.9rem; }
.note { font-size: 0.85rem; color: var(--muted); margin-top: 1rem; text-align: center; }
.links { display: flex; flex-direction: column; gap: 0.65rem; margin-top: 1.25rem; text-align: center; }
.alert { padding: 0.75rem 1rem; border-radius: 10px; font-size: 0.9rem; margin-bottom: 1rem; }
.alert.error { background: #fef2f2; color: var(--red); border: 1px solid #fecaca; }

/* Dashboard layout */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.85rem 1.5rem; background: var(--slate); color: #fff;
}
.topbar .brand { font-size: 1.05rem; }
.topbar-right { display: flex; align-items: center; gap: 1rem; font-size: 0.9rem; }
.topbar-right .email { color: rgba(255,255,255,0.75); }
.main { flex: 1; padding: 1.5rem; max-width: 1100px; margin: 0 auto; width: 100%; }
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.6rem; margin-bottom: 0.25rem; }
.page-header p { color: var(--muted); font-size: 0.95rem; }
.stats { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.stat {
  background: var(--white); border: 1px solid var(--line); border-radius: 12px;
  padding: 1rem 1.25rem; min-width: 140px;
}
.stat .label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; }
.stat .value { font-size: 1.5rem; font-weight: 700; margin-top: 0.15rem; }

.inspection-list { display: flex; flex-direction: column; gap: 0.75rem; }
.inspection-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: var(--white); border: 1px solid var(--line); border-radius: 12px;
  padding: 1rem 1.25rem; cursor: pointer; transition: box-shadow 0.15s ease;
}
.inspection-row:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
.inspection-row h3 { font-size: 1rem; margin-bottom: 0.15rem; }
.inspection-row .meta { font-size: 0.88rem; color: var(--muted); }
.pill {
  display: inline-block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  padding: 0.2rem 0.55rem; border-radius: 999px;
}
.pill.draft { background: #eef2ff; color: #4338ca; }
.pill.completed { background: #dcfce7; color: var(--green); }
.pill.archived { background: #f1f5f9; color: var(--muted); }

.detail-back { margin-bottom: 1rem; }
.detail-card {
  background: var(--white); border: 1px solid var(--line); border-radius: 12px;
  padding: 1.25rem; margin-bottom: 1rem;
}
.detail-card h2 { font-size: 1.2rem; margin-bottom: 0.35rem; }
.findings { display: flex; flex-direction: column; gap: 0.75rem; }
.finding {
  display: grid; grid-template-columns: 72px 1fr; gap: 1rem;
  background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 1rem;
}
.finding img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; background: var(--bg); }
.finding .thumb-placeholder {
  width: 72px; height: 72px; border-radius: 8px; background: var(--bg);
  display: grid; place-items: center; color: var(--muted); font-size: 1.4rem;
}
.finding h4 { font-size: 0.95rem; margin-bottom: 0.25rem; }
.finding .section { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; font-weight: 600; }
.finding .narrative { font-size: 0.9rem; color: var(--navy); margin-top: 0.35rem; }
.severity { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; padding: 0.15rem 0.5rem; border-radius: 999px; }
.severity.defect { background: #fee2e2; color: var(--red); }
.severity.acceptable { background: #dcfce7; color: var(--green); }
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty h3 { color: var(--slate); margin-bottom: 0.5rem; }
.loading { text-align: center; padding: 2rem; color: var(--muted); }

@media (max-width: 880px) {
  .layout { grid-template-columns: 1fr; }
  .rail { display: none; }
  .finding { grid-template-columns: 1fr; }
  .finding img, .finding .thumb-placeholder { width: 100%; height: 160px; }
}
