:root {
  color-scheme: light;
  --ink: #25263d;
  --ink-soft: #60627a;
  --muted: #85879a;
  --paper: #f7f5f0;
  --surface: #fff;
  --line: #ebe9e3;
  --violet: #6659d9;
  --violet-dark: #4f45bb;
  --violet-soft: #f0eeff;
  --rose: #cb5661;
  --rose-soft: #fff0f0;
  --amber: #bd791b;
  --amber-soft: #fff5e3;
  --green: #267e62;
  --green-soft: #eaf7f1;
  --shadow: 0 10px 34px rgb(43 42 73 / 5%);
  --radius: 17px;
  font-family: Vazirmatn, Tahoma, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: inherit; font-size: 14px; line-height: 1.8; }
button, input, select, textarea { color: inherit; font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgb(102 89 217 / 32%); outline-offset: 2px; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 20; inset: 0 0 0 auto; display: flex; width: 252px; flex-direction: column; padding: 25px 17px 18px; background: #27283f; color: #f7f6ff; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 7px 26px; }
.brand-mark { display: grid; width: 43px; height: 43px; place-items: center; border-radius: 14px; background: linear-gradient(145deg, #8c82f5, #6559db); color: #fff; font-size: 23px; font-weight: 800; box-shadow: 0 8px 20px rgb(114 103 224 / 28%); }
.brand strong { display: block; font-size: 17px; letter-spacing: -.3px; }
.brand small { display: block; margin-top: 1px; color: #b8b8d0; font-size: 10px; }
.app-nav { display: grid; gap: 5px; }
.nav-link { display: flex; width: 100%; align-items: center; gap: 11px; border: 0; border-radius: 11px; padding: 10px 11px; background: transparent; color: #c7c8dc; text-align: right; transition: background .16s ease, color .16s ease; }
.nav-link:hover { background: rgb(255 255 255 / 7%); color: #fff; }
.nav-link.active { background: #41415e; color: #fff; box-shadow: inset -3px 0 #a49afa; }
.nav-icon { display: inline-grid; width: 23px; height: 23px; flex: 0 0 23px; place-items: center; border-radius: 7px; background: rgb(255 255 255 / 7%); color: #d9d6ff; font-size: 15px; }
.sidebar-bottom { margin-top: auto; }
.local-badge { display: flex; align-items: center; gap: 8px; margin: 0 7px 13px; color: #c4e7d8; font-size: 10px; }
.local-dot { width: 7px; height: 7px; border-radius: 50%; background: #68d2a4; box-shadow: 0 0 0 4px rgb(104 210 164 / 12%); }
.sidebar-bottom > p { margin: 12px 7px 0; color: #989ab6; font-size: 10px; line-height: 1.9; }
.main-content { min-height: 100vh; margin-right: 252px; padding: 30px clamp(20px, 4vw, 58px) 20px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 auto 25px; max-width: 1440px; }
.eyebrow { display: block; margin: 0 0 5px; color: var(--violet); font-size: 10px; font-weight: 800; letter-spacing: .35px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 1px; font-size: 25px; line-height: 1.45; letter-spacing: -.55px; }
.page-subtitle { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.topbar-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; }
.mode-pill { display: inline-flex; align-items: center; border: 1px solid transparent; border-radius: 99px; padding: 5px 10px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.mode-empty { border-color: #e2e0d8; background: #f0eee9; color: #77786f; }
.mode-real { border-color: #c9e8db; background: #e9f7f0; color: #267457; }
.mode-sample { border-color: #e6d9ff; background: #f2ecff; color: #7351b2; }
.page-section { max-width: 1440px; margin: 0 auto; animation: page-in .24s ease both; }
@keyframes page-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; padding: 9px 15px; font-size: 12px; font-weight: 700; line-height: 1.4; transition: transform .14s ease, background .14s ease, box-shadow .14s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--violet); color: #fff; box-shadow: 0 6px 14px rgb(102 89 217 / 16%); }
.button-primary:hover { background: var(--violet-dark); }
.button-secondary { border-color: #e5e2dc; background: #fff; color: #4b4c62; }
.button-secondary:hover { border-color: #d0cbed; background: #fbfaff; }
.button-danger { border-color: #f1d0d2; background: #fff; color: #b44650; }
.button-danger:hover { background: #fff4f4; }
.button-small { min-height: 35px; padding: 7px 11px; font-size: 11px; }
.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.text-button { border: 0; padding: 4px 0; background: transparent; color: var(--violet); font-size: 11px; font-weight: 800; white-space: nowrap; }
.text-button:hover { color: var(--violet-dark); text-decoration: underline; text-underline-offset: 3px; }
.state-banner { display: flex; align-items: center; gap: 10px; max-width: 1440px; margin: -6px auto 18px; border: 1px solid #e8dafa; border-radius: 12px; padding: 10px 13px; background: #faf6ff; color: #654d8a; font-size: 11px; }
.state-banner .info-icon { flex: 0 0 auto; }
.banner-recalc, .banner-close { flex: 0 0 auto; margin-right: auto; border: 0; background: transparent; color: inherit; font-size: 11px; font-weight: 800; }
.banner-close { font-size: 18px; }

.onboarding-panel { position: relative; display: flex; min-height: 275px; align-items: center; justify-content: space-between; overflow: hidden; margin-bottom: 26px; border: 1px solid #e9e3ff; border-radius: 21px; padding: 30px clamp(24px, 4vw, 52px); background: linear-gradient(112deg, #fff 10%, #f4f0ff 100%); box-shadow: var(--shadow); }
.onboarding-copy { position: relative; z-index: 1; max-width: 620px; }
.onboarding-copy h2 { max-width: 570px; margin: 7px 0 9px; font-size: clamp(22px, 2.4vw, 31px); line-height: 1.5; letter-spacing: -.5px; }
.onboarding-copy p { max-width: 560px; margin-bottom: 19px; color: var(--ink-soft); font-size: 12px; }
.onboarding-art { position: relative; width: 330px; height: 220px; flex: 0 0 330px; margin-left: 20px; }
.art-card { position: absolute; display: flex; flex-direction: column; justify-content: center; border: 1px solid rgb(255 255 255 / 80%); border-radius: 15px; background: rgb(255 255 255 / 85%); box-shadow: 0 18px 36px rgb(72 61 142 / 13%); transform: rotate(-6deg); }
.art-card-back { top: 20px; right: 12px; width: 246px; height: 96px; padding: 17px; color: #777296; }
.art-card-back span { font-size: 10px; }
.art-card-back b { margin-top: 5px; color: #41415d; font-size: 13px; }
.art-card-front { right: 50px; bottom: 12px; width: 220px; height: 106px; padding: 16px 18px; transform: rotate(4deg); }
.art-card-front b { margin-top: 2px; font-size: 15px; }
.art-card-front small { color: var(--muted); font-size: 10px; }
.art-symbol { position: absolute; top: 8px; left: 15px; color: #399a74; font-size: 25px; font-weight: 700; }
.art-spark { position: absolute; color: #eab45e; }
.spark-one { top: 9px; left: 30px; font-size: 23px; }
.spark-two { right: 2px; bottom: 31px; color: #8d80ea; font-size: 18px; }

.dashboard-heading, .panel-heading, .page-intro-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.dashboard-heading { margin-bottom: 12px; }
.dashboard-heading h2, .panel-heading h2, .page-intro h2 { margin: 0; font-size: 17px; letter-spacing: -.2px; }
.dashboard-heading p, .panel-heading p { margin: 2px 0 0; }
.muted { color: var(--muted); font-size: 11px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 16px; }
.metric-card { min-height: 133px; border: 1px solid var(--line); border-radius: 15px; padding: 15px 17px; background: #fff; box-shadow: var(--shadow); }
.metric-top { display: flex; align-items: center; justify-content: space-between; color: var(--ink-soft); font-size: 11px; }
.metric-icon { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 10px; font-size: 14px; font-weight: 800; }
.metric-card > strong { display: block; margin-top: 2px; font-size: 28px; line-height: 1.45; font-variant-numeric: tabular-nums; }
.metric-card > small { color: var(--muted); font-size: 10px; }
.metric-lilac .metric-icon { background: var(--violet-soft); color: var(--violet); }
.metric-rose .metric-icon { background: var(--rose-soft); color: var(--rose); }
.metric-amber .metric-icon { background: var(--amber-soft); color: var(--amber); }
.metric-mint .metric-icon { background: var(--green-soft); color: var(--green); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(310px, .82fr); gap: 15px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: var(--surface); box-shadow: var(--shadow); }
.panel-heading { margin-bottom: 14px; }
.panel-heading h2 { font-size: 15px; }
.priority-list { display: grid; }
.priority-item { display: flex; align-items: center; gap: 11px; min-width: 0; border-top: 1px solid #f0efeb; padding: 12px 0; }
.priority-item:first-child { border-top: 0; padding-top: 2px; }
.priority-marker { width: 8px; height: 34px; flex: 0 0 8px; border-radius: 9px; }
.marker-high { background: var(--rose); }
.marker-medium { background: #e7aa45; }
.marker-low { background: #54a482; }
.priority-copy { min-width: 0; flex: 1; }
.priority-copy strong, .priority-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.priority-copy strong { font-size: 11px; }
.priority-copy small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.priority-score { min-width: 38px; text-align: center; }
.priority-score b { display: block; font-size: 17px; line-height: 1.2; }
.priority-score small { color: var(--muted); font-size: 8px; }
.compact-heading { margin: 0 0 8px; }
.compact-heading h3 { margin: 0; font-size: 12px; }
.coverage-stat { padding: 5px 0 11px; }
.coverage-stat > div:first-child { display: flex; justify-content: space-between; gap: 8px; color: var(--ink-soft); font-size: 10px; }
.coverage-stat strong { color: var(--ink); font-size: 15px; }
.coverage-stat strong small { color: var(--muted); font-size: 9px; font-weight: 500; }
.coverage-track, .progress-track { height: 8px; overflow: hidden; border-radius: 99px; background: #eeedf2; }
.coverage-track { margin-top: 8px; }
.coverage-track span, .progress-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8b7ff0, #6457d8); transition: width .25s ease; }
.coverage-detail { display: grid; gap: 8px; padding: 5px 0 9px; color: var(--ink-soft); font-size: 10px; }
.coverage-detail > span { display: flex; align-items: center; gap: 7px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; }
.dot-warning { background: #dfa044; }
.dot-muted { background: #a7a6b0; }
.panel-divider { height: 1px; margin: 10px 0 13px; background: #f0efeb; }
.mini-action-list { display: grid; gap: 8px; }
.mini-action { display: flex; align-items: flex-start; gap: 9px; }
.mini-action-dot { width: 8px; height: 8px; flex: 0 0 8px; margin-top: 7px; border-radius: 50%; background: #8d81e5; }
.mini-action-dot.is-overdue { background: var(--rose); }
.mini-action strong, .mini-action small { display: block; }
.mini-action strong { font-size: 10px; }
.mini-action small { color: var(--muted); font-size: 9px; }
.dashboard-footer-note { display: flex; align-items: flex-start; gap: 9px; margin: 14px 2px 0; color: #78798b; font-size: 10px; }
.info-icon { display: inline-grid; width: 19px; height: 19px; flex: 0 0 19px; place-items: center; border-radius: 50%; background: #eeecff; color: var(--violet); font-family: Georgia, serif; font-size: 12px; font-weight: 700; }
.empty-inline { display: grid; justify-items: start; gap: 3px; padding: 13px 0; color: var(--muted); font-size: 10px; }
.empty-state { display: grid; min-height: 180px; justify-items: center; align-content: center; gap: 5px; padding: 25px; color: var(--ink-soft); text-align: center; }
.empty-state strong { color: var(--ink); font-size: 12px; }
.empty-state p { max-width: 420px; margin: 0 0 6px; color: var(--muted); font-size: 10px; }
.empty-icon { display: grid; width: 40px; height: 40px; place-items: center; margin-bottom: 5px; border-radius: 14px; background: #f2f0ff; color: var(--violet); font-size: 18px; }
.compact-empty { min-height: 145px; }

.page-intro { margin: 3px 0 18px; }
.page-intro h2 { margin-bottom: 3px; font-size: 20px; }
.page-intro p { margin: 0; color: var(--muted); font-size: 11px; }
.form-panel { padding: clamp(18px, 3vw, 28px); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.field { display: flex; min-width: 0; flex-direction: column; gap: 5px; }
.field-full { grid-column: 1 / -1; }
.field label { color: #45465b; font-size: 10px; font-weight: 800; }
.field small { color: var(--muted); font-size: 9px; }
.required { color: var(--rose); }
.field input, .field select, .search-input, .select-input { width: 100%; min-height: 42px; border: 1px solid #e5e3df; border-radius: 9px; padding: 9px 11px; background: #fff; color: var(--ink); font-size: 11px; }
.field textarea { width: 100%; min-height: 90px; border: 1px solid #e5e3df; border-radius: 9px; padding: 9px 11px; background: #fff; color: var(--ink); font-size: 11px; resize: vertical; }
.field input::placeholder, .search-input::placeholder { color: #a9a9b1; }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; border-top: 1px solid #f0efeb; padding-top: 17px; }
.page-intro-row { margin-bottom: 17px; }
.page-intro-row .page-intro { margin: 0; }
.supply-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; margin-bottom: 14px; }
.supply-summary-card { display: flex; align-items: center; justify-content: space-between; gap: 9px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; }
.supply-summary-card span { color: var(--ink-soft); font-size: 10px; }
.supply-summary-card strong { font-size: 19px; }
.summary-attention strong { color: var(--amber); }
.table-panel { margin-bottom: 14px; padding: 17px 19px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 10px; text-align: right; }
thead th { border-bottom: 1px solid #ebe9e4; padding: 10px 9px; color: #8a8b99; font-size: 9px; font-weight: 700; white-space: nowrap; }
tbody td { border-bottom: 1px solid #f1f0ec; padding: 11px 9px; color: #494a5d; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
td strong, td small { display: block; }
td strong { color: var(--ink); font-size: 10px; }
td small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.criticality, .coverage-pill, .supplier-status, .historical-tag { display: inline-flex; align-items: center; gap: 5px; border-radius: 99px; padding: 4px 8px; font-size: 9px; font-weight: 700; white-space: nowrap; }
.critical-high { background: #fff0ef; color: #bd4f53; }
.critical-medium { background: #fff5e3; color: #a76c19; }
.critical-low { background: #eef1f4; color: #6e7380; }
.coverage-good { background: #eaf7f1; color: #267e62; }
.coverage-risk { background: #fff0ef; color: #bd4f53; }
.coverage-unknown { background: #f1f0ed; color: #767783; }
.supplier-status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-normal { background: #eaf7f1; color: #267e62; }
.status-watch { background: #fff5e3; color: #a76c19; }
.status-risk { background: #fff0ef; color: #bd4f53; }
.table-actions { min-width: 100px; text-align: left; white-space: nowrap; }
.icon-action { border: 0; padding: 4px 5px; background: transparent; color: var(--violet); font-size: 9px; font-weight: 700; }
.icon-action-danger { color: #b74b56; }
.event-severity { display: inline-flex; border-radius: 99px; padding: 3px 8px; font-size: 9px; font-weight: 800; }
.severity-low { background: #eef1f4; color: #6e7380; }
.severity-medium { background: #fff5e3; color: #a76c19; }
.severity-high { background: #fff0ef; color: #bd4f53; }
.event-description { min-width: 180px; max-width: 340px; white-space: normal; }
.report-event-list { display: grid; gap: 6px; margin: 0; padding: 0 17px 0 0; color: #515266; font-size: 9px; }
.report-event-list li::marker { color: var(--violet); }
.report-event-list strong, .report-event-list small { display: block; }
.report-event-list small { color: var(--muted); }

.assessment-summary { display: flex; align-items: center; gap: 20px; margin-bottom: 12px; padding: 14px 17px; }
.assessment-summary > div:first-child { display: flex; min-width: 135px; flex-direction: column; }
.assessment-summary strong { font-size: 12px; }
.assessment-summary .muted { font-size: 9px; }
.progress-track { flex: 1; }
.assessment-tip { display: flex; align-items: center; gap: 9px; margin: 0 2px 14px; border: 1px solid #e8e4fa; border-radius: 11px; padding: 9px 12px; background: #f8f7ff; color: #6b6981; font-size: 10px; }
.assessment-tip .text-button { margin-right: auto; }
.question-list { display: grid; gap: 10px; }
.question-card { border: 1px solid var(--line); border-radius: 14px; padding: 15px 17px; background: #fff; box-shadow: 0 5px 18px rgb(43 42 73 / 3%); }
.question-heading { display: flex; align-items: center; gap: 10px; }
.question-number { display: grid; width: 29px; height: 29px; flex: 0 0 29px; place-items: center; border-radius: 9px; background: #f0eeff; color: var(--violet); font-size: 11px; font-weight: 800; }
.question-category { color: var(--violet); font-size: 9px; font-weight: 700; }
.question-heading h3 { margin: 1px 0 0; font-size: 12px; }
.answer-state { margin-right: auto; border-radius: 99px; padding: 4px 8px; background: #f3f2ef; color: #898a93; font-size: 8px; white-space: nowrap; }
.answer-good { background: #eaf7f1; color: #267e62; }
.answer-needs-action { background: #fff0ef; color: #bd4f53; }
.answer-unknown { background: #fff5e3; color: #a76c19; }
.question-prompt { margin: 9px 0 12px; color: #535469; font-size: 11px; }
.answer-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.answer-option { position: relative; display: flex; min-height: 38px; align-items: center; gap: 7px; border: 1px solid #eeece8; border-radius: 9px; padding: 7px 9px; background: #fff; color: #666779; cursor: pointer; font-size: 9px; transition: border-color .15s ease, background .15s ease; }
.answer-option:hover { border-color: #c9c3f2; background: #fbfaff; }
.answer-option:has(input:checked) { border-color: #a9a1ed; background: #f5f3ff; color: #4f45a8; }
.answer-option input { width: 13px; height: 13px; margin: 0; accent-color: var(--violet); }
.sticky-action-bar { position: sticky; z-index: 5; bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 14px; border: 1px solid #dedbef; border-radius: 13px; padding: 10px 13px; background: rgb(255 255 255 / 94%); box-shadow: 0 8px 25px rgb(44 40 88 / 10%); backdrop-filter: blur(10px); }

.filter-row { display: flex; gap: 8px; }
.search-input { min-width: 210px; }
.select-input { width: auto; min-width: 125px; }
.inline-alert { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; border: 1px solid #dedcf3; border-radius: 10px; padding: 9px 12px; background: #f6f5ff; color: #5f5b82; font-size: 10px; }
.inline-alert > span:first-child { display: grid; width: 19px; height: 19px; flex: 0 0 19px; place-items: center; border-radius: 50%; background: #e8e5ff; color: var(--violet); font-weight: 800; }
.alert-warning { border-color: #f0dfbb; background: #fff9eb; color: #866125; }
.alert-warning > span:first-child { background: #fff0cf; color: #a66b14; }
.result-meta { display: flex; flex-wrap: wrap; gap: 7px 18px; margin: 0 0 12px; color: var(--muted); font-size: 9px; }
.risk-list { display: grid; gap: 11px; }
.risk-card { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; background: #fff; box-shadow: var(--shadow); }
.risk-card-head { display: flex; justify-content: space-between; gap: 15px; }
.risk-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-bottom: 3px; }
.risk-category, .source-pill { color: var(--muted); font-size: 9px; }
.source-pill { border-radius: 99px; padding: 2px 7px; background: #f1efff; color: #6b61b8; }
.risk-card h3 { margin: 0; font-size: 14px; }
.risk-score-box { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.risk-score-box > strong { font-size: 18px; line-height: 1.2; }
.risk-score-box > strong small { color: var(--muted); font-size: 9px; font-weight: 500; }
.risk-badge { display: inline-flex; align-items: center; border-radius: 99px; padding: 4px 8px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.risk-high { background: #fff0ef; color: #bd4f53; }
.risk-medium { background: #fff5e3; color: #a76c19; }
.risk-low { background: #eaf7f1; color: #267e62; }
.risk-explanation { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 14px; border-top: 1px solid #f0efeb; padding-top: 12px; }
.risk-explanation strong, .risk-action .action-label { color: #414257; font-size: 10px; }
.risk-explanation p { margin: 3px 0 0; color: #727386; font-size: 10px; }
.risk-detail-row { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 10px; color: #77788a; font-size: 9px; }
.critical-review-flag { display: inline-flex; align-items: center; width: fit-content; border: 1px solid #f0c9c6; border-radius: 999px; padding: 3px 8px; background: #fff1ef; color: #a63e3c; font-size: 9px; font-weight: 800; }
.review-needed-flag { display: inline-flex; align-items: center; width: fit-content; border: 1px solid #f2dfb9; border-radius: 999px; padding: 3px 8px; background: #fff8e9; color: #91621d; font-size: 9px; font-weight: 800; }
.risk-source { display: grid; gap: 3px; margin-top: 12px; border-right: 2px solid #c8c4e5; padding: 3px 10px 3px 0; color: #77788a; font-size: 9px; overflow-wrap: anywhere; }
.risk-source strong { color: #514c7d; }
.risk-source a { color: #514c7d; text-decoration: underline; text-underline-offset: 2px; }
.risk-source small { line-height: 1.7; }
.detail-icon { color: var(--violet); font-style: normal; }
.risk-action { margin-top: 11px; border-right: 3px solid #8a7fe6; border-radius: 0 6px 6px 0; padding: 7px 10px 6px 0; }
.risk-action p { margin: 2px 0 3px; color: #494a5e; font-size: 10px; }
.risk-action small { color: var(--muted); font-size: 9px; }
.risk-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; border-top: 1px solid #f0efeb; padding-top: 8px; color: var(--muted); font-size: 8px; }

.action-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; margin-bottom: 13px; }
.action-summary-card { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; background: #fff; }
.action-summary-card span { color: var(--ink-soft); font-size: 10px; }
.action-summary-card strong { font-size: 18px; }
.action-summary-overdue strong { color: var(--rose); }
.table-input { display: block; width: 100%; min-width: 100px; min-height: 34px; margin: 2px 0; border: 1px solid #e8e6e1; border-radius: 7px; padding: 6px 8px; background: #fff; font-size: 9px; }
.notes-input { min-width: 180px; min-height: 53px; resize: vertical; }
.historical-row { opacity: .72; }
.historical-tag { margin-top: 4px; background: #f0efec; color: #767680; }
.overdue-label { display: inline-block; margin-top: 4px; color: var(--rose); font-size: 9px; font-weight: 800; }

.report-panel { padding: clamp(18px, 3vw, 30px); }
.report-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.report-header h2 { margin: 0 0 2px; font-size: 19px; }
.report-header p { margin: 0; color: var(--muted); font-size: 10px; }
.report-date { display: grid; justify-items: end; gap: 3px; color: var(--muted); font-size: 9px; }
.report-date strong { color: var(--ink); font-size: 10px; }
.sample-watermark { border-radius: 99px; padding: 3px 7px; background: #f3edff; color: #7650ae; font-size: 9px; font-weight: 800; }
.report-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 15px 0 20px; }
.report-stats > div { display: grid; gap: 3px; border-radius: 10px; padding: 9px 11px; background: #f8f7f4; }
.report-stats span { color: var(--muted); font-size: 9px; }
.report-stats strong { font-size: 17px; }
.text-high { color: var(--rose); }
.text-medium { color: var(--amber); }
.text-low { color: var(--green); }
.report-section { margin-top: 19px; }
.report-section h3 { margin-bottom: 9px; font-size: 12px; }
.report-material-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.report-material { display: grid; gap: 2px; border: 1px solid #efeee9; border-radius: 9px; padding: 9px 11px; }
.report-material strong { font-size: 10px; }
.report-material span, .report-material small { color: var(--muted); font-size: 9px; }
.report-method { margin-top: 20px; border: 1px solid #e8e5f7; border-radius: 10px; padding: 12px 14px; background: #f9f8ff; }
.report-method strong { color: #514c7d; font-size: 10px; }
.report-method p { margin: 3px 0 0; color: #74728b; font-size: 9px; }
.report-disclaimer { margin: 10px 2px; color: var(--muted); font-size: 9px; }

.settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.settings-card { min-height: 218px; }
.settings-icon { display: grid; width: 35px; height: 35px; place-items: center; margin-bottom: 13px; border-radius: 11px; background: #f1efff; color: var(--violet); font-size: 17px; }
.settings-card h3 { margin-bottom: 5px; font-size: 13px; }
.settings-card p { min-height: 51px; margin-bottom: 14px; color: var(--muted); font-size: 10px; }
.settings-danger .settings-icon { background: #fff0ef; color: var(--rose); }
.storage-note { margin-top: 14px; border: 1px solid #e9e5dc; border-radius: 12px; padding: 15px 17px; background: #fffdf8; }
.storage-note strong { font-size: 11px; }
.storage-note p { margin: 3px 0 7px; color: #77776f; font-size: 10px; }
.storage-note span { color: var(--muted); font-size: 9px; }
.app-footer { display: flex; justify-content: space-between; gap: 12px; max-width: 1440px; margin: 25px auto 0; border-top: 1px solid #eae8e2; padding-top: 12px; color: #9696a0; font-size: 9px; }

.app-dialog { width: min(620px, calc(100% - 28px)); max-height: min(88vh, 800px); overflow: auto; border: 1px solid #e6e3dc; border-radius: 17px; padding: 0; color: var(--ink); box-shadow: 0 28px 90px rgb(30 28 52 / 24%); }
.app-dialog::backdrop { background: rgb(31 30 49 / 48%); backdrop-filter: blur(2px); }
.dialog-form { padding: 22px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.dialog-heading h2 { margin: 0; font-size: 17px; }
.icon-button { display: grid; width: 34px; height: 34px; place-items: center; border: 0; border-radius: 9px; background: #f3f2ef; color: #686978; font-size: 21px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; border-top: 1px solid #f0efeb; padding-top: 14px; }
.app-toast { position: fixed; z-index: 100; right: 25px; bottom: 22px; max-width: min(430px, calc(100vw - 32px)); border: 1px solid #45445f; border-radius: 11px; padding: 11px 15px; background: #292940; color: #fff; font-size: 11px; box-shadow: 0 12px 32px rgb(20 20 40 / 20%); opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .18s ease, transform .18s ease; }
.app-toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 1120px) {
  .sidebar { width: 220px; }
  .main-content { margin-right: 220px; padding-inline: 25px; }
  .onboarding-art { width: 260px; flex-basis: 260px; transform: scale(.9); transform-origin: center right; margin-left: 0; }
  .answer-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 850px) {
  .sidebar { position: sticky; top: 0; inset: auto; width: 100%; min-height: auto; padding: 10px 15px 8px; }
  .brand { padding: 0 3px 8px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 11px; font-size: 18px; }
  .brand strong { font-size: 14px; }
  .brand small { font-size: 9px; }
  .app-nav { display: flex; overflow-x: auto; gap: 5px; padding-bottom: 2px; scrollbar-width: thin; }
  .nav-link { width: auto; flex: 0 0 auto; gap: 6px; padding: 7px 9px; font-size: 10px; white-space: nowrap; }
  .nav-icon { width: 19px; height: 19px; flex-basis: 19px; font-size: 12px; }
  .nav-link.active { box-shadow: inset 0 -2px #a49afa; }
  .sidebar-bottom { display: none; }
  .main-content { margin: 0; padding: 22px 20px 16px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .onboarding-art { width: 260px; flex-basis: 260px; }
}
@media (max-width: 620px) {
  .topbar { align-items: flex-start; margin-bottom: 18px; }
  .topbar-actions { flex-direction: column-reverse; align-items: flex-end; gap: 5px; }
  .topbar-actions .button { min-height: 35px; padding: 7px 9px; font-size: 10px; }
  h1 { font-size: 20px; }
  .page-subtitle { max-width: 260px; font-size: 10px; }
  .state-banner { align-items: flex-start; font-size: 9px; }
  .onboarding-panel { min-height: 0; padding: 22px 19px; }
  .onboarding-copy h2 { font-size: 22px; }
  .onboarding-copy p { font-size: 10px; }
  .onboarding-art { display: none; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .metric-card { min-height: 115px; padding: 11px 12px; }
  .metric-card > strong { font-size: 24px; }
  .metric-top { font-size: 9px; }
  .metric-icon { width: 27px; height: 27px; }
  .dashboard-heading, .page-intro-row { align-items: flex-start; flex-direction: column; }
  .dashboard-heading .button { align-self: flex-start; }
  .page-intro-row .button-row { width: 100%; }
  .page-intro-row .button-row .button { flex: 1; }
  .panel { padding: 15px; }
  .form-grid { grid-template-columns: 1fr; gap: 12px; }
  .field-full { grid-column: auto; }
  .form-footer { align-items: flex-start; flex-direction: column; }
  .supply-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .supply-summary-card { padding: 9px 10px; }
  .supply-summary-card span { font-size: 9px; }
  .table-panel { padding: 13px 10px; }
  .table-panel .panel-heading { padding-inline: 5px; }
  table { min-width: 660px; }
  .assessment-summary { align-items: stretch; flex-direction: column; gap: 8px; }
  .assessment-summary > div:first-child { flex-direction: row; align-items: baseline; justify-content: space-between; }
  .assessment-tip { align-items: flex-start; flex-wrap: wrap; font-size: 9px; }
  .assessment-tip .text-button { margin-right: 28px; }
  .question-card { padding: 12px; }
  .question-heading { gap: 7px; }
  .question-number { width: 25px; height: 25px; flex-basis: 25px; }
  .question-heading h3 { font-size: 11px; }
  .answer-state { padding: 3px 6px; font-size: 7px; }
  .answer-options { grid-template-columns: 1fr 1fr; gap: 6px; }
  .answer-option { min-height: 42px; padding: 6px; font-size: 8px; }
  .sticky-action-bar { bottom: 8px; align-items: flex-start; flex-direction: column; gap: 6px; }
  .sticky-action-bar .button { width: 100%; }
  .filter-row { width: 100%; }
  .search-input { min-width: 0; flex: 1; }
  .risk-card { padding: 13px; }
  .risk-card h3 { max-width: 220px; font-size: 12px; }
  .risk-explanation { grid-template-columns: 1fr; gap: 8px; }
  .risk-card-footer { align-items: flex-start; }
  .action-summary { gap: 7px; }
  .action-summary-card { align-items: flex-start; flex-direction: column-reverse; gap: 2px; padding: 8px; }
  .action-summary-card strong { font-size: 17px; }
  .report-header { flex-direction: column; }
  .report-date { justify-items: start; }
  .report-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .report-material-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-card { min-height: 0; }
  .settings-card p { min-height: 0; }
  .app-footer { flex-direction: column; gap: 2px; }
  .app-toast { right: 12px; bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
  body { background: #fff; font-size: 10pt; }
  .sidebar, .topbar, .state-banner, .app-footer, .no-print, #page-dashboard, #page-business, #page-supply, #page-assessment, #page-risks, #page-actions, #page-settings { display: none !important; }
  .main-content { margin: 0; padding: 0; }
  #page-report { display: block !important; max-width: none; }
  #page-report > .page-intro { display: none; }
  .report-panel { border: 0; padding: 0; box-shadow: none; }
  .report-section, .risk-card, table, tr { break-inside: avoid; }
  .app-footer { display: none; }
}
