/* Web shell */
.web-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: 244px;
  display: flex;
  flex-direction: column;
  color: white;
  background: var(--ink-950);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  min-height: 84px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--red-600);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.06em;
}

.brand-copy strong,
.brand-copy span {
  display: block;
}

.brand-copy strong {
  font-size: 15px;
}

.brand-copy span {
  margin-top: 3px;
  color: #a9a19d;
  font-size: 11px;
}

.nav {
  flex: 1;
  padding: 14px 12px;
  overflow: auto;
}

.nav-label {
  margin: 14px 10px 8px;
  color: #77706d;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.nav-item {
  width: 100%;
  min-height: 44px;
  margin: 3px 0;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  color: #c8c2be;
  background: transparent;
  border: 0;
  border-radius: 10px;
  text-align: left;
  font-weight: 700;
}

.nav-item:hover {
  color: white;
  background: rgba(255, 255, 255, 0.07);
}

.nav-item.active {
  color: white;
  background: var(--red-600);
}

.nav-icon {
  width: 24px;
  font-size: 16px;
  text-align: center;
}

.sidebar-foot {
  padding: 14px;
  display: grid;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-controls {
  display: grid;
  gap: 10px;
}

.sidebar-control-status {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-control-field {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.sidebar-control-field > span {
  color: #8f8884;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.sidebar .data-freshness {
  min-width: 0;
  flex: 1;
  padding: 0 2px;
  color: #d8d2ce;
  background: transparent;
  border: 0;
}

.sidebar .data-freshness span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar .role-switcher,
.sidebar .period-switcher {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  color: white;
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  font-size: 12px;
}

.sidebar :is(.role-switcher, .period-switcher) option {
  color: var(--ink-950);
  background: white;
}

.sidebar-foot-card {
  padding: 12px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
}

.sidebar-foot-card strong,
.sidebar-foot-card span {
  display: block;
}

.sidebar-foot-card span {
  margin-top: 4px;
  color: #8f8884;
  font-size: 11px;
}

.web-main {
  grid-column: 2;
  min-width: 0;
  overflow: clip;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 58px;
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  background: rgba(246, 242, 239, 0.92);
  border-bottom: 1px solid rgba(136, 104, 90, 0.14);
  backdrop-filter: blur(14px);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-500);
  font-size: 13px;
}

.breadcrumb strong {
  color: var(--ink-950);
}

.scope-bar {
  position: sticky;
  top: 58px;
  z-index: 39;
  min-height: 58px;
  padding: 10px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(255, 253, 251, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.scope-bar-copy,
.scope-breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.scope-bar-copy > span {
  color: var(--ink-500);
  font-size: 12px;
  font-weight: 800;
}

.scope-actions {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.scope-filter {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.scope-filter > span {
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.scope-breadcrumbs button,
.scope-breadcrumbs strong {
  color: var(--ink-950);
  font: inherit;
  font-size: 13px;
}

.scope-breadcrumbs button {
  padding: 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid currentColor;
  cursor: pointer;
}

.scope-breadcrumbs button:focus-visible,
.scope-filter select:focus-visible {
  outline: 2px solid var(--red-600);
  outline-offset: 3px;
}

.scope-separator {
  color: var(--ink-400);
}

.scope-filter select {
  min-width: 126px;
  min-height: 34px;
  padding: 0 10px;
  color: var(--ink-800);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
}

.scope-picker select {
  min-width: 190px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.data-freshness {
  min-height: 34px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-600);
  background: rgba(255, 253, 251, 0.74);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.data-freshness i {
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(24, 121, 78, 0.1);
}

.role-switcher,
.period-switcher {
  min-height: 42px;
  padding: 0 12px;
  color: var(--ink-950);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-weight: 700;
}

.page {
  display: none;
  padding: 28px;
  animation: fade-in 180ms ease;
}

.page.active {
  display: block;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-title-row {
  margin-bottom: 22px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.page-title-row h1,
.page-title-row p {
  margin: 0;
}

.page-title-row h1 {
  font-size: 28px;
  letter-spacing: -0.03em;
}

.page-title-row p {
  margin-top: 7px;
  color: var(--ink-500);
  font-size: 14px;
}

.summary-strip {
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.command-banner {
  margin-bottom: 16px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  color: white;
  background:
    linear-gradient(115deg, rgba(225, 37, 27, 0.96), rgba(143, 16, 16, 0.98)),
    var(--red-700);
  border-radius: 16px;
  box-shadow: 0 14px 32px rgba(143, 16, 16, 0.18);
}

.command-banner-copy {
  min-width: 0;
}

.command-index {
  display: block;
  margin-bottom: 5px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.command-banner strong {
  display: block;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.command-banner p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
}

.command-banner-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.command-banner .btn-dark {
  background: white;
  color: var(--red-700);
}

.command-banner .btn-ghost {
  color: white;
  border-color: rgba(255, 255, 255, 0.38);
}

.summary-card {
  position: relative;
  min-height: 142px;
  padding: 18px;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid rgba(132, 97, 83, 0.14);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
}

.summary-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 76px;
  height: 6px;
  background: var(--red-600);
}

.summary-card:nth-child(2)::after {
  background: var(--amber);
}

.summary-card:nth-child(3)::after {
  background: var(--ink-950);
}

.summary-card:nth-child(4)::after {
  background: var(--green);
}

.summary-card .label {
  color: var(--ink-500);
  font-size: 13px;
  font-weight: 700;
}

.summary-card .value {
  margin: 16px 0 8px;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.summary-card .meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink-500);
  font-size: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(330px, 0.85fr);
  gap: 16px;
}

.dashboard-grid .span-all {
  grid-column: 1 / -1;
}

.map-canvas {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  background:
    linear-gradient(30deg, transparent 44%, rgba(255, 255, 255, 0.75) 45%, rgba(255, 255, 255, 0.75) 49%, transparent 50%) 0 0 / 190px 140px,
    linear-gradient(120deg, transparent 44%, rgba(255, 255, 255, 0.68) 45%, rgba(255, 255, 255, 0.68) 49%, transparent 50%) 0 0 / 220px 160px,
    #e8e3dd;
  border-radius: 0 0 16px 16px;
}

.map-canvas::before,
.map-canvas::after {
  content: "";
  position: absolute;
  background: rgba(135, 164, 126, 0.22);
  border-radius: 42% 58% 64% 36%;
}

.map-canvas::before {
  width: 180px;
  height: 120px;
  left: 8%;
  top: 10%;
}

.map-canvas::after {
  width: 220px;
  height: 150px;
  right: 8%;
  bottom: 8%;
}

.map-tag {
  position: absolute;
  z-index: 2;
  padding: 8px 11px;
  background: rgba(255, 253, 251, 0.94);
  border: 1px solid rgba(112, 85, 75, 0.17);
  border-radius: 10px;
  color: var(--ink-600);
  font-size: 11px;
  font-weight: 700;
  box-shadow: var(--shadow-soft);
}

.map-marker {
  position: absolute;
  z-index: 4;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--ink-950);
  border: 4px solid white;
  border-radius: 50% 50% 50% 8px;
  box-shadow: 0 7px 18px rgba(44, 20, 14, 0.25);
  transform: rotate(-45deg);
  transition: transform 150ms ease;
}

.map-marker span {
  transform: rotate(45deg);
  font-size: 10px;
  font-weight: 900;
}

.map-marker:hover,
.map-marker.active {
  transform: rotate(-45deg) scale(1.14);
}

.map-marker.risk {
  background: var(--red-600);
}

.map-marker.warn {
  background: var(--amber);
}

.map-marker.good {
  background: var(--green);
}

.map-legend {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 5;
  padding: 10px 12px;
  display: flex;
  gap: 12px;
  background: rgba(255, 253, 251, 0.95);
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  font-size: 11px;
  font-weight: 700;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-item i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.ranking-list {
  display: grid;
  gap: 8px;
}

.ranking-item {
  padding: 14px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.ranking-item:last-child {
  border-bottom: 0;
}

.ranking-no {
  color: var(--red-600);
  font-size: 18px;
  font-weight: 900;
}

.ranking-copy strong,
.ranking-copy span {
  display: block;
}

.ranking-copy strong {
  font-size: 13px;
}

.ranking-copy span {
  margin-top: 3px;
  color: var(--ink-500);
  font-size: 11px;
}

.ranking-gap {
  color: var(--red-700);
  font-weight: 900;
}

.chart-wrap {
  height: 250px;
}

.chart-wrap canvas {
  width: 100%;
  height: 100%;
}

.issue-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.issue-card {
  padding: 18px;
  background: var(--paper);
  border: 1px solid rgba(132, 97, 83, 0.14);
  border-radius: 15px;
  box-shadow: var(--shadow-soft);
}

.issue-card .issue-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.issue-card h3 {
  margin: 0;
  font-size: 16px;
}

.issue-card .gap-value {
  margin: 18px 0 10px;
  color: var(--red-700);
  font-size: 30px;
  font-weight: 900;
}

.metric-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.metric-compare div {
  padding: 9px 10px;
  background: #f5f1ee;
  border-radius: 8px;
}

.metric-compare span,
.metric-compare strong {
  display: block;
}

.metric-compare span {
  color: var(--ink-500);
  font-size: 10px;
}

.metric-compare strong {
  margin-top: 2px;
  font-size: 14px;
}

.ai-card {
  margin-top: 14px;
  padding: 14px;
  background: var(--red-50);
  border: 1px solid #f7cbc7;
  border-radius: 10px;
}

.ai-card strong {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--red-700);
  font-size: 12px;
}

.ai-card p {
  margin: 8px 0 0;
  color: var(--ink-600);
  font-size: 12px;
  line-height: 1.65;
}

.evidence-list {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-600);
  font-size: 12px;
  line-height: 1.8;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  overscroll-behavior-inline: contain;
}

.data-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  color: var(--ink-500);
  background: #faf7f5;
  font-size: 12px;
  font-weight: 800;
}

.data-table td {
  font-size: 13px;
}

.data-table tbody tr:hover {
  background: var(--red-50);
}

.table-action {
  padding: 0;
  color: var(--red-700);
  background: none;
  border: 0;
  font-size: 12px;
  font-weight: 800;
}

.org-toolbar {
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.org-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.org-breadcrumb button {
  padding: 0;
  color: var(--red-700);
  background: none;
  border: 0;
  font-weight: 800;
}

.org-level-grid {
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.org-level-card {
  padding: 18px;
}

.org-level-card h3,
.org-level-card p {
  margin: 0;
}

.org-level-card p {
  margin-top: 8px;
  color: var(--ink-500);
  font-size: 12px;
}

.progress {
  height: 7px;
  overflow: hidden;
  background: #ebe5e1;
  border-radius: 999px;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--red-600);
  border-radius: inherit;
}

.competitor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
  gap: 16px;
}

.competitor-list {
  display: grid;
  gap: 10px;
}

.competitor-card {
  padding: 14px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.competitor-brand {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--ink-950);
  color: white;
  font-size: 11px;
  font-weight: 900;
}

.competitor-card:nth-child(2) .competitor-brand {
  background: #e19a00;
}

.competitor-card:nth-child(3) .competitor-brand {
  background: #176d44;
}

.competitor-copy strong,
.competitor-copy span {
  display: block;
}

.competitor-copy span {
  margin-top: 3px;
  color: var(--ink-500);
  font-size: 11px;
}

.competitor-score {
  text-align: right;
}

.competitor-score strong,
.competitor-score span {
  display: block;
}

.competitor-score strong {
  color: var(--red-700);
}

.competitor-score span {
  color: var(--ink-500);
  font-size: 10px;
}

.stepper {
  margin: 8px 0 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.step {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  color: var(--ink-500);
  font-size: 12px;
  font-weight: 700;
}

.step::after {
  content: "";
  position: absolute;
  top: 15px;
  left: 50%;
  z-index: 0;
  width: 100%;
  height: 2px;
  background: var(--line);
}

.step:last-child::after {
  display: none;
}

.step i {
  position: relative;
  z-index: 1;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--ink-500);
  background: #eee8e4;
  border-radius: 50%;
  font-style: normal;
}

.step.active,
.step.done {
  color: var(--red-700);
}

.step.active i,
.step.done i {
  color: white;
  background: var(--red-600);
}

.upload-zone {
  min-height: 250px;
  padding: 30px;
  display: grid;
  place-items: center;
  text-align: center;
  background: #faf7f5;
  border: 2px dashed #d9cec8;
  border-radius: 14px;
}

.upload-zone h3 {
  margin: 14px 0 5px;
}

.upload-zone p {
  margin: 0 0 16px;
  color: var(--ink-500);
  font-size: 12px;
}

.upload-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  color: var(--red-700);
  background: var(--red-100);
  border-radius: 50%;
  font-size: 24px;
}

.validation-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.validation-card {
  padding: 14px;
  background: #f8f5f3;
  border-radius: 10px;
}

.validation-card strong,
.validation-card span {
  display: block;
}

.validation-card strong {
  font-size: 24px;
}

.validation-card span {
  margin-top: 4px;
  color: var(--ink-500);
  font-size: 11px;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.report-card {
  padding: 20px;
}

.report-card-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.report-card h3,
.report-card p {
  margin: 0;
}

.report-card p {
  margin-top: 8px;
  color: var(--ink-500);
  font-size: 12px;
  line-height: 1.6;
}

.report-actions {
  margin-top: 18px;
  display: flex;
  gap: 8px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.settings-card {
  min-height: 180px;
  padding: 20px;
}

.settings-card h3 {
  margin: 12px 0 8px;
}

.settings-card p {
  margin: 0;
  color: var(--ink-500);
  font-size: 12px;
  line-height: 1.6;
}


