.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: .65rem 1rem;
  border: 2px solid var(--strim-navy);
  border-radius: 8px;
  color: white;
  background: var(--strim-navy);
  text-decoration: none;
  font-weight: 750;
  cursor: pointer;
}
.button:hover { color: white; background: var(--strim-blue); border-color: var(--strim-blue); }
.button-secondary { color: var(--strim-navy); background: white; }
.button-secondary:hover, .button-ghost:hover { color: var(--strim-navy); background: var(--strim-green-light); border-color: var(--strim-navy); }
.button-ghost { min-height: 34px; padding: .4rem .75rem; color: var(--strim-navy); background: white; }
.button-large { min-height: 50px; padding-inline: 1.35rem; }
.button-small { min-height: 36px; padding: .4rem .7rem; font-size: .88rem; }
.button-full { width: 100%; }
.button-row, .hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, .7fr);
  gap: 3rem;
  min-height: 520px;
  align-items: center;
  margin: -2.2rem -1.25rem 3rem;
  padding: clamp(3rem, 8vw, 6rem) max(1.25rem, calc((100vw - var(--content)) / 2));
  overflow: hidden;
  color: white;
  background:
    linear-gradient(110deg, rgb(0 43 85 / 98%) 0 55%, rgb(0 74 152 / 88%) 100%),
    radial-gradient(circle at 90% 20%, var(--strim-green), transparent 40%);
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  width: 520px;
  height: 120px;
  right: -140px;
  transform: rotate(-35deg);
}
.hero::before { top: 30px; background: var(--strim-green); }
.hero::after { bottom: 20px; background: var(--strim-red); }
.hero-copy, .hero-panel { position: relative; z-index: 1; }
.hero h1 { max-width: 760px; color: white; }
.hero p { font-size: 1.15rem; color: rgb(255 255 255 / 82%); }
.hero .eyebrow { color: var(--strim-green-light); }
.hero-panel {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 18%);
  border-radius: var(--radius);
  background: rgb(255 255 255 / 12%);
  backdrop-filter: blur(8px);
}
.hero-panel div { display: grid; gap: .2rem; padding: 1.35rem; background: rgb(0 43 85 / 35%); }
.hero-panel strong { font-size: 1.55rem; }
.hero-panel span { color: rgb(255 255 255 / 72%); }
.public-scope { margin: 3rem 0; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2rem; }
.dashboard-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.module-card, .detail-card, .question-card, .form-card, .filter-panel {
  padding: 1.4rem;
  border: 1px solid var(--strim-grey-200);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow);
}
.module-card { position: relative; overflow: hidden; }
.module-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--strim-green); }
.module-card h2, .module-card h3 { margin-bottom: .65rem; }
.card-link { color: inherit; text-decoration: none; transition: transform .16s ease, box-shadow .16s ease; }
.card-link:hover { color: inherit; transform: translateY(-4px); box-shadow: 0 22px 50px rgb(0 43 85 / 16%); }
.card-index { display: block; margin-bottom: 1rem; color: var(--strim-green); font-size: 1.5rem; font-weight: 900; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; margin-bottom: 1.2rem; }
.detail-card { margin-bottom: 1.2rem; box-shadow: none; }
.detail-card dl { display: grid; grid-template-columns: minmax(140px, .4fr) 1fr; gap: .55rem 1rem; margin: 0; }
dt { color: var(--strim-grey-600); font-weight: 700; }
dd { margin: 0; }
.inline-dl { display: flex !important; flex-wrap: wrap; gap: .5rem 1rem !important; }
.table-wrap { width: 100%; margin: 1.2rem 0; overflow-x: auto; border: 1px solid var(--strim-grey-200); border-radius: 10px; background: white; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: .8rem .75rem; border-bottom: 1px solid var(--strim-grey-200); text-align: left; vertical-align: top; }
th { color: var(--strim-navy); background: var(--strim-green-light); font-size: .78rem; letter-spacing: .025em; }
tbody tr:hover { background: var(--strim-grey-050); }
.row-muted { color: var(--strim-grey-600); background: var(--strim-grey-100); }
.badge { display: inline-flex; padding: .25rem .55rem; border-radius: 999px; color: var(--strim-navy); background: var(--strim-green-light); font-size: .78rem; font-weight: 800; }
.badge-risk { background: #fff3d0; }
.badge-quality { margin: .2rem; color: white; background: var(--risk-high); }
.quality-strip { margin-bottom: 1rem; }
.disclaimer {
  margin: 2rem 0 0;
  padding: 1rem 1.2rem;
  border-left: 6px solid var(--strim-red);
  color: #3e474f;
  background: #fff3f3;
}
.disclaimer p { margin: .25rem 0 0; }
.alert { max-width: var(--content); margin: 1rem auto; padding: .85rem 1rem; border-radius: 8px; border-left: 5px solid var(--strim-blue); background: #eaf4ff; }
.alert-error { border-color: var(--strim-red); background: #fff1f1; }
.alert-warning { border-color: var(--risk-medium); background: #fff7df; }
.alert-success { border-color: var(--risk-moderate); background: #eef9f1; }
.messages { padding: 0 1.25rem; }
.results-summary, .data-origin { margin: 1rem 0; padding: .75rem 1rem; border-radius: 8px; background: var(--strim-green-light); }
.pagination { display: flex; justify-content: center; gap: 1rem; align-items: center; margin: 1.5rem 0; }
.causal-chain { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin: 2rem 0; padding: 0; list-style: none; }
.causal-chain li { position: relative; min-height: 170px; padding: 1.15rem; border: 1px solid var(--strim-grey-200); border-top: 6px solid var(--strim-green); border-radius: 10px; background: white; }
.causal-chain li:not(:last-child)::after { content: "→"; position: absolute; top: 50%; right: -1.05rem; z-index: 2; color: var(--strim-blue); font-size: 1.5rem; font-weight: 900; }
.causal-chain li > span { display: inline-grid; place-items: center; width: 30px; height: 30px; margin-bottom: .6rem; border-radius: 50%; color: white; background: var(--strim-navy); }
.control-check { border-left: 6px solid var(--strim-red); }
.result-hero { padding: 2rem; border-radius: var(--radius); color: white; background: var(--strim-navy); }
.result-hero h1 { color: white; }
.question-card { margin: 1rem 0; }
.question-card legend { color: var(--strim-navy); font-size: 1.15rem; font-weight: 800; }
.question-card legend span { display: inline-grid; place-items: center; width: 32px; height: 32px; margin-right: .6rem; border-radius: 50%; color: white; background: var(--strim-green); }
.option { display: flex; gap: .6rem; align-items: flex-start; margin: .65rem 0; padding: .6rem; border-radius: 8px; background: var(--strim-grey-050); cursor: pointer; }
.option input { margin-top: .32rem; }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-panel { grid-template-columns: repeat(3, 1fr); }
  .card-grid, .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .causal-chain { grid-template-columns: repeat(2, 1fr); }
  .causal-chain li::after { display: none; }
}
@media (max-width: 640px) {
  .hero-panel, .card-grid, .dashboard-grid, .detail-grid, .causal-chain { grid-template-columns: 1fr; }
  .detail-card dl { grid-template-columns: 1fr; }
}
.reference {
  display: block;
  margin-top: .25rem;
  color: var(--strim-grey-600);
  font-size: .78rem;
  font-weight: 600;
}
.data-quality-card {
  margin: 1rem 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--strim-grey-200);
  border-left: 6px solid var(--risk-medium);
  border-radius: 9px;
  background: #fffaf0;
}
.data-quality-card strong { color: var(--strim-navy); }
.badge-quality {
  gap: .35rem;
  color: var(--strim-black);
  background: #fff3d0;
  border: 1px solid var(--risk-medium);
}
.quality-icon { font-weight: 900; }
.technical-title { max-width: 920px; }
.technical-title .reference { margin-top: .55rem; }
.control-list { display: grid; gap: .8rem; padding: 0; list-style: none; }
.control-list li { padding: .85rem; border-left: 4px solid var(--risk-medium); background: var(--strim-grey-050); }
.feedback-launcher {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .65rem .9rem;
  border: 2px solid var(--strim-navy);
  border-radius: 999px;
  color: white;
  background: var(--strim-red);
  box-shadow: var(--shadow);
  text-decoration: none;
  font-weight: 800;
}
.feedback-launcher:hover,
.feedback-launcher:focus-visible { color: white; background: var(--strim-navy); }
.kpi-grid { margin: 1.2rem 0; }
.kpi-value { display: block; color: var(--strim-navy); font-size: clamp(1.8rem, 4vw, 3rem); }
@media (max-width: 640px) {
  .feedback-launcher { right: .6rem; bottom: .6rem; max-width: calc(100vw - 1.2rem); }
}

/* Phase 3: three-mode workflows */
.three-mode-grid .module-card { min-height: 260px; }
.card-action { display: inline-block; margin-top: 1rem; color: var(--strim-blue); font-weight: 800; }
.backoffice-navigation { border-top: 1px solid rgb(255 255 255 / 18%); padding-top: .15rem; padding-bottom: .15rem; }
.backoffice-navigation::before { content: "Backoffice"; align-self: center; margin-right: .35rem; color: rgb(255 255 255 / 68%); font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.submode-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 1.5rem; }
.submode-tabs a { padding: .55rem .85rem; border: 1px solid var(--strim-grey-200); border-radius: 999px; background: white; text-decoration: none; font-weight: 750; }
.submode-tabs a.is-active { color: white; background: var(--strim-navy); border-color: var(--strim-navy); }
.advanced-filters { margin: 1rem 0; padding: 1rem; border: 1px solid var(--strim-grey-200); border-radius: 10px; background: var(--strim-grey-050); }
.advanced-filters summary { color: var(--strim-navy); cursor: pointer; font-weight: 800; }
.workflow-stepper { margin: 1rem 0 2rem; }
.workflow-stepper ol { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; margin: 0; padding: 0; list-style: none; }
.workflow-stepper li { display: flex; align-items: center; gap: .5rem; padding: .6rem; border: 1px solid var(--strim-grey-200); border-radius: 8px; background: white; color: var(--strim-grey-600); font-size: .84rem; font-weight: 750; }
.workflow-stepper li span { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--strim-grey-600); }
.workflow-stepper li.is-complete { color: var(--strim-navy); border-color: var(--strim-green); }
.workflow-stepper li.is-complete span { color: var(--strim-navy); border-color: var(--strim-green); background: var(--strim-green-light); }
.workflow-stepper li.is-current { box-shadow: inset 0 -4px 0 var(--strim-green); }
.chain-legend { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; margin: 1rem 0; padding: .75rem; border: 1px solid var(--strim-grey-200); border-radius: 10px; background: white; box-shadow: var(--shadow); }
.chain-chip { display: inline-flex; gap: .3rem; align-items: center; padding: .3rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 800; }
.chain-cause { background: #e8f0ff; }
.chain-hazard { background: #fff4d8; }
.chain-event { background: #ffe7e7; }
.chain-scenario { background: #ede8ff; }
.chain-consequence { background: #ffe8f3; }
.chain-control { background: #e6f7ea; }
.risk-question-block { margin: 1.5rem 0 2.4rem; padding: 1rem; border: 2px solid var(--strim-grey-200); border-radius: var(--radius); background: var(--strim-grey-050); }
.risk-question-block > header { margin-bottom: 1rem; }
.risk-question-block > header h2 { margin: .5rem 0; }
.chain-element-cause { border-left: 6px solid #6d8fd6; }
.chain-element-hazard { border-left: 6px solid #d6a72c; }
.chain-element-event { border-left: 6px solid #d45b5b; }
.chain-element-scenario { border-left: 6px solid #7765bd; }
.chain-element-consequence { border-left: 6px solid #bd5b87; }
.chain-element-control { border-left: 6px solid #4b9a5d; }
.chain-element-chain { border-left: 6px solid var(--strim-navy); }
.badge-row { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .7rem; }
.badge-success { background: #e6f7ea; border: 1px solid #4b9a5d; }
.badge-warning { background: #fff4d8; border: 1px solid #d6a72c; }
.history-list { display: grid; gap: .7rem; padding-left: 1.3rem; }
.history-list li { padding-left: .3rem; }
@media (max-width: 720px) {
  .workflow-stepper ol { grid-template-columns: 1fr 1fr; }
  .chain-legend { position: static; }
}

/* Phase 4 contrast corrections */
.card-index { color: var(--risk-moderate); }
.question-card legend span { color: white; background: var(--risk-moderate); }
.badge-quality { color: white; background: var(--risk-critical); }
.backoffice-navigation::before { color: rgb(255 255 255 / 88%); }
