:root {
  --primary: #184f90;
  --accent: #2f76c7;
  --bg: #eff4f9;
  --card: #ffffff;
  --line: #d6e1ee;
  --text: #1f2a36;
  --muted: #627181;
  --good: #14804a;
  --warn: #b17800;
  --bad: #b93030;
  --shadow: 0 14px 34px rgba(24,79,144,.12);
  --radius: 22px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif; background: var(--bg); color: var(--text); }
input, select, textarea, button { font: inherit; }
button { cursor: pointer; }
.app-shell { display: grid; grid-template-columns: 320px 1fr; min-height: 100vh; }
.sidebar { background: #103863; color: #fff; padding: 18px; position: sticky; top: 0; height: 100vh; overflow: auto; }
.brand-card { display: flex; gap: 14px; align-items: center; background: rgba(255,255,255,.08); border-radius: 20px; padding: 12px; margin-bottom: 16px; }
.brand-logo { width: 78px; height: 78px; object-fit: contain; background: #f3f3f3; border-radius: 14px; }
.brand-card h1 { margin: 0 0 4px; font-size: 1.15rem; }
.brand-card p { margin: 0; color: rgba(255,255,255,.8); font-size: .9rem; }
.score-panel { background: rgba(255,255,255,.08); border-radius: 20px; padding: 14px; margin-bottom: 16px; }
.score-panel__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.score-gauge { height: 10px; background: rgba(255,255,255,.16); border-radius: 999px; overflow: hidden; }
.score-gauge > div { height: 100%; width: 0; background: linear-gradient(90deg,#27a75c,#f0b429,#cf3434); }
.score-badges { display: grid; gap: 8px; margin: 12px 0; }
.score-pill { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.1); font-size: .88rem; }
.score-rating { font-weight: 700; }
.section-nav { display: grid; gap: 8px; }
.nav-btn { text-align: left; border: 0; border-radius: 14px; padding: 11px 13px; background: rgba(255,255,255,.08); color: #fff; }
.nav-btn.active, .nav-btn:hover { background: rgba(255,255,255,.18); }
.sidebar-tools { display: grid; gap: 10px; margin-top: 16px; }
.main-content { padding: 20px; max-width: 1160px; margin: 0 auto; width: 100%; }
.hero-card { background: linear-gradient(135deg,var(--primary),var(--accent)); color: #fff; border-radius: 26px; padding: 22px; display: flex; justify-content: space-between; gap: 18px; box-shadow: var(--shadow); }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; margin: 0 0 6px; opacity: .85; }
.hero-card h2 { margin: 0 0 8px; font-size: 1.9rem; }
.hero-card p { margin: 0; max-width: 640px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.progress-wrap, .dashboard-grid, .risk-banner, .form-card { margin-top: 16px; }
.progress-meta { display: flex; justify-content: space-between; margin-bottom: 6px; }
.progress-bar { height: 10px; background: #dce7f1; border-radius: 999px; overflow: hidden; }
.progress-fill { width: 0; height: 100%; background: linear-gradient(90deg,var(--primary),var(--accent)); }
.dashboard-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.dashboard-card { background: var(--card); border-radius: 18px; padding: 14px; box-shadow: var(--shadow); }
.dashboard-card span { display: block; font-size: .84rem; color: var(--muted); }
.dashboard-card strong { display: block; margin-top: 6px; font-size: 1.15rem; }
.risk-banner { display: grid; gap: 10px; }
.banner-card { background: #fff8ea; border: 1px solid #efd59b; color: #6f5300; padding: 14px 16px; border-radius: 16px; }
.banner-card.bad { background: #fff3f3; border-color: #f0c3c3; color: #972626; }
.banner-card.good { background: #eef8f1; border-color: #bde5c8; color: #17653a; }
.form-card { display: none; background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.form-card.active { display: block; }
.section-header { margin-bottom: 16px; }
.section-header h3 { margin: 0 0 6px; font-size: 1.28rem; }
.section-header p { margin: 0; color: var(--muted); }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2,minmax(0,1fr)); }
label { display: flex; flex-direction: column; gap: 8px; font-weight: 600; }
label span { font-size: .95rem; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; background: #fff; color: var(--text); }
textarea { resize: vertical; }
.full { grid-column: 1 / -1; }
.stacked { margin-top: 14px; }
.checkbox-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.checkbox-grid label { flex-direction: row; align-items: center; gap: 10px; border: 1px solid var(--line); padding: 12px 14px; border-radius: 14px; background: #fbfdff; font-weight: 500; }
.checkbox-grid input { width: 18px; height: 18px; margin: 0; }
.measurement-cards { display: grid; gap: 14px; margin-top: 14px; }
.measure-card { border: 1px solid var(--line); border-radius: 18px; padding: 14px; background: #fbfdff; }
.measure-card__top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.measure-card__top strong { font-size: 1.02rem; }
.band { display: inline-flex; align-items: center; border-radius: 999px; padding: 6px 10px; font-size: .8rem; font-weight: 700; }
.band.good { background: #eef8f1; color: var(--good); }
.band.warn { background: #fff6e8; color: var(--warn); }
.band.bad { background: #fff2f2; color: var(--bad); }
.measure-card__grid { display: grid; grid-template-columns: .9fr .6fr 1.3fr; gap: 10px; }
.measure-card__help { margin-top: 10px; color: var(--muted); font-size: .85rem; }
.upload-drop { display: grid; place-items: center; min-height: 120px; border: 2px dashed #b7cde6; border-radius: 18px; background: #f8fbff; color: var(--primary); font-weight: 700; position: relative; overflow: hidden; }
.upload-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-grid { display: grid; gap: 14px; margin-top: 14px; }
.photo-item { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 12px; }
.photo-thumb { width: 100%; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: #edf4fb; }
.photo-thumb img { width: 100%; height: 100%; object-fit: contain; }
.photo-actions { display: flex; gap: 10px; margin-top: 10px; }
.risk-list { display: grid; gap: 12px; }
.risk-card { border-radius: 16px; padding: 14px 16px; border: 1px solid var(--line); background: #fff; }
.risk-card.good { background: #eef8f1; border-color: #bde5c8; }
.risk-card.warn { background: #fff8ea; border-color: #efd59b; }
.risk-card.bad { background: #fff3f3; border-color: #f0c3c3; }
.signature-wrap { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: #fff; }
#signaturePad { width: 100%; height: 220px; display: block; touch-action: none; background: linear-gradient(to bottom, transparent 95%, #eef4fa 95%) 0 0 / 100% 44px, #fff; }
.toolbar.inline, .form-footer { display: flex; gap: 10px; margin-top: 14px; }
.form-footer { justify-content: space-between; padding-bottom: 32px; }
.btn { border: 0; border-radius: 14px; min-height: 46px; padding: 12px 15px; font-weight: 700; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-secondary { background: #e5eef8; color: var(--primary); }
.btn-ghost { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.22); }
.file-btn { position: relative; overflow: hidden; }
.report-root { position: fixed; inset: 0; opacity: 0; pointer-events: none; overflow: auto; }
.muted { color: var(--muted); }
@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(84vw, 330px); transform: translateX(-100%); transition: transform .25s ease; z-index: 40; }
  .sidebar.open { transform: translateX(0); }
  .main-content { padding: 14px; }
  .hero-card { flex-direction: column; }
  .dashboard-grid, .grid.two, .checkbox-grid, .measure-card__grid { grid-template-columns: 1fr; }
}
