.metric-card {
  height: 108px;
  padding: 16px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.metric-card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 17px;
  font-weight: 430;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-card strong {
  display: block;
  color: var(--text-base);
  font-family: var(--font-alt);
  font-size: 22px;
  line-height: 26px;
  font-weight: 400;
}

.metric-card div {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 17px;
}

.metric-card .danger,
.danger {
  color: var(--danger);
}

.metric-card .success,
.success {
  color: var(--success);
}

/* Security Exposure */

.security-metrics {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 8px;
}

.metric-card.wide {
  width: auto;
}

.security-grid {
  margin-top: 16px;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(420px, 1fr);
  gap: 16px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: 8px;
  overflow: hidden;
}

.card-header {
  min-height: 72px;
  padding: 16px 24px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border-base);
}

.card-header h3 {
  margin: 0 0 4px;
  color: var(--text-base);
  font-size: 16px;
  line-height: 19px;
  font-weight: 430;
}

.card-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 17px;
  font-weight: 430;
}

.card-header.split {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.card-header.split > div {
  width: min(392px, calc(100% - 170px));
}

.dark-button {
  height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--button-dark);
  color: #ffffff;
  box-shadow: var(--shadow-dark);
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
}

/* Organisation Security Score card */

.security-score-card {
  width: 100%;
  min-height: 532px;
  background: #ffffff;
}

.security-score-card .card-header {
  height: 72px;
  min-height: 72px;
  padding: 16px 24px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border-base);
}

.security-score-card .card-header h3 {
  margin: 0 0 4px;
  color: #000000;
  font-size: 16px;
  line-height: 19px;
  font-weight: 430;
}

.security-score-card .card-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 17px;
  font-weight: 430;
}

.security-score-section {
  position: relative;
  padding: 24px;
}

.score-total {
  min-height: 209px;
}

.score-distribution {
  min-height: 250px;
  padding-top: 29px;
}

.score-content {
  max-width: 273px;
}

.score-content h4 {
  margin: 0 0 5px;
  color: var(--text-base);
  font-size: 16px;
  line-height: 19px;
  font-weight: 430;
}

.score-content p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 17px;
  font-weight: 430;
}

.security-mini-stats {
  display: flex;
  gap: 24px;
  margin-top: 30px;
}

.stat-line {
  position: relative;
  padding-left: 7px;
  min-width: 43px;
}

.stat-line::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1px;
  width: 1px;
  height: 34px;
  background: var(--accent);
}

.stat-line.weak {
  --accent: var(--danger);
}

.stat-line.medium {
  --accent: var(--warning);
}

.stat-line.strong {
  --accent: var(--success);
}

.stat-line span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 14px;
  font-weight: 430;
}

.stat-line strong {
  display: block;
  margin-top: 2px;
  color: var(--text-base);
  font-size: 20px;
  line-height: 24px;
  font-weight: 430;
}

.trend {
  margin-top: 13px !important;
  color: var(--text-base) !important;
  font-family: var(--font-alt);
  font-size: 14px !important;
  line-height: 17px !important;
  font-weight: 400 !important;
}

.trend .danger {
  color: var(--danger);
}

.score-divider {
  height: 1px;
  background: var(--border-base);
}

.score-gauge {
  position: absolute;
  right: 18px;
  top: 50px;
  width: 220px;
  height: 140px;
}

.score-gauge svg {
  width: 220px;
  height: 140px;
  display: block;
  overflow: visible;
}

.score-gauge-track,
.score-gauge-progress {
  fill: none;
  stroke-linecap: round;
  stroke-width: 6;
}

.score-gauge-track {
  stroke: #f8f8f8;
}

.score-gauge-progress {
  stroke: url(#securityGaugeGradient);
  stroke-dasharray: 30 100;
  stroke-dashoffset: 0;
}

.score-gauge-label {
  position: absolute;
  left: 80px;
  top: 82px;
  width: 60px;
  text-align: center;
}

.score-gauge-label strong {
  display: block;
  color: var(--text-base);
  font-size: 24px;
  line-height: 29px;
  font-weight: 430;
}

.score-gauge-label span {
  display: block;
  margin-top: -1px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 14px;
  font-weight: 430;
}

/* Risk card */

.risk-card {
  width: 100%;
  min-height: 532px;
}

.risk-card .card-header {
  min-height: 82px;
  background: #ffffff;
}

/* Tables */

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

thead {
  background: var(--bg-soft);
}

th {
  height: 38px;
  color: var(--text-base);
  font-size: 12px;
  line-height: 14px;
  font-weight: 430;
  text-align: left;
  border-bottom: 1px solid var(--border-base);
}

td {
  height: 38px;
  color: #000000;
  font-family: var(--font-alt);
  font-size: 12px;
  line-height: 14px;
  font-weight: 400;
  border-bottom: 1px solid var(--border-base);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.risk-card th:nth-child(1),
.risk-card td:nth-child(1),
.friction-card th:nth-child(1),
.friction-card td:nth-child(1) {
  width: 38%;
  padding-left: 24px;
}

.risk-card th:nth-child(2),
.risk-card td:nth-child(2) {
  width: 42%;
  padding-left: 8px;
}

.risk-card th:nth-child(3),
.risk-card td:nth-child(3) {
  width: 20%;
  padding-left: 8px;
}

.risk-card td:nth-child(3) {
  color: var(--danger);
  font-weight: 600;
}

.table-footer {
  height: 50px;
  padding: 0 24px;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #000000;
  font-size: 12px;
  line-height: 14px;
}

/* Shadow IT */

.shadow-layout {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(360px, 454px) minmax(520px, 1fr);
  gap: 16px;
}

.shadow-metrics {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  grid-auto-rows: 108px;
  gap: 12px;
}

.shadow-table-card {
  width: 100%;
  min-height: 539px;
}

.shadow-table-card .card-header {
  height: 72px;
}

.shadow-table-card th:nth-child(1),
.shadow-table-card td:nth-child(1) {
  width: 28%;
  padding-left: 24px;
}

.shadow-table-card th:nth-child(2),
.shadow-table-card td:nth-child(2) {
  width: 26%;
  padding-left: 8px;
}

.shadow-table-card th:nth-child(3),
.shadow-table-card td:nth-child(3) {
  width: 18%;
  padding-left: 8px;
}

.shadow-table-card th:nth-child(4),
.shadow-table-card td:nth-child(4) {
  width: 28%;
  padding-left: 8px;
}

/* Login Behaviour */

.login-behaviour {
  margin-top: 96px;
}

.login-heading {
  max-width: 458px;
  margin-bottom: 39px;
}

.login-comparison {
  width: 100%;
  max-width: none;
  height: 292px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: #ffffff;
  border: 1px solid var(--border-base);
  border-radius: 8px;
  overflow: hidden;
}

.login-column {
  min-width: 0;
  display: grid;
  grid-template-rows: 72px 110px 110px;
}

.login-column + .login-column {
  border-left: 1px solid var(--border-base);
}

.login-column-title {
  height: 72px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border-base);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000000;
  font-size: 16px;
  line-height: 19px;
  font-weight: 430;
}

.login-cell {
  height: 110px;
  padding: 16px 24px;
  background: #ffffff;
}

.login-cell + .login-cell {
  border-top: 1px solid var(--border-base);
}

.login-cell p {
  margin: 0;
  color: rgba(0, 0, 0, 0.8);
  font-size: 14px;
  line-height: 17px;
  font-weight: 430;
}

.login-cell strong {
  display: block;
  margin-top: 16px;
  color: var(--text-base);
  font-family: var(--font-alt);
  font-size: 22px;
  line-height: 26px;
  font-weight: 400;
}

.empty-cell {
  background: #ffffff;
}

.login-bottom-grid {
  width: 100%;
  max-width: none;
  margin-top: 34px;
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(420px, 1fr);
  gap: 16px;
  align-items: start;
}

.login-chart-card,
.friction-card {
  min-width: 0;
}

.login-chart-card {
  width: 100%;
  height: 304px;
  position: relative;
  padding: 0;
  background: #ffffff;
  border-radius: 8px;
}

.login-chart-card h3 {
  margin: 0;
  padding: 24px 24px 0;
  color: var(--text-base);
  font-size: 14px;
  line-height: 17px;
  font-weight: 430;
}

.login-chart-wrap {
  position: absolute;
  left: 25px;
  right: 25px;
  top: 65px;
  height: 181px;
}

.y-axis {
  position: absolute;
  left: 0;
  top: 0;
  width: 20px;
  height: 181px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  color: var(--text-muted);
  font-size: 8px;
  line-height: 10px;
  font-weight: 430;
}

.login-line-chart {
  position: absolute;
  left: 25px;
  right: 0;
  top: 4px;
  width: calc(100% - 25px);
  height: 174px;
  overflow: visible;
}

.chart-grid line {
  stroke: #ebeced;
  stroke-width: 1;
}

.manual-login-line,
.sso-login-line {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.manual-login-line {
  stroke: #f43f6e;
}

.sso-login-line {
  stroke: #16c476;
}

.manual-points circle {
  fill: #f43f6e;
}

.sso-points circle {
  fill: #16c476;
}

.chart-legend {
  position: absolute;
  left: 48px;
  bottom: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-subtle);
  font-size: 12px;
  line-height: 14px;
  font-weight: 430;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-legend i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.manual-dot {
  background: #f43f6e;
}

.sso-dot {
  background: #16c476;
}

.friction-card {
  width: 100%;
  height: 554px;
  background: #ffffff;
  border-radius: 8px;
}

.friction-header {
  height: 89px;
  min-height: 89px;
  padding: 16px 16px 16px 24px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-base);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.friction-header > div {
  width: auto;
  max-width: calc(100% - 188px);
}

.friction-header h3 {
  margin: 0 0 4px;
  color: var(--text-base);
  font-size: 16px;
  line-height: 19px;
  font-weight: 430;
}

.friction-header p {
  width: auto;
  max-width: 358px;
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 17px;
  font-weight: 430;
}

.friction-header .dark-button {
  width: 168px;
  height: 28px;
  padding: 0 8px;
  font-size: 14px;
  flex-shrink: 0;
}

.friction-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.friction-table thead {
  background: var(--bg-soft);
}

.friction-table th {
  height: 38px;
  padding-top: 0;
  padding-bottom: 0;
  color: var(--text-base);
  font-size: 12px;
  line-height: 14px;
  font-weight: 430;
  text-align: left;
  border-bottom: 1px solid var(--border-base);
}

.friction-table td {
  height: 38px;
  padding-top: 0;
  padding-bottom: 0;
  color: #000000;
  font-family: var(--font-alt);
  font-size: 12px;
  line-height: 14px;
  font-weight: 400;
  border-bottom: 1px solid var(--border-base);
  white-space: nowrap;
}

.friction-table th:nth-child(1),
.friction-table td:nth-child(1) {
  width: 38%;
  padding-left: 24px;
}

.friction-table th:nth-child(2),
.friction-table td:nth-child(2) {
  width: 24%;
  padding-left: 8px;
}

.friction-table th:nth-child(3),
.friction-table td:nth-child(3) {
  width: 19%;
  padding-left: 8px;
}

.friction-table th:nth-child(4),
.friction-table td:nth-child(4) {
  width: 19%;
  padding-left: 8px;
}

.friction-footer {
  height: 50px;
  padding: 0 24px;
  background: var(--bg-soft);
  justify-content: flex-start;
}

/* Cell state helpers */

.danger-cell {
  color: var(--danger) !important;
  font-weight: 600 !important;
}

.security-score-cell {
  color: var(--danger) !important;
  font-weight: 600 !important;
}

/* Responsive */

@media (max-width: 1280px) {
  .security-metrics {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .security-grid,
  .login-bottom-grid {
    grid-template-columns: 1fr;
  }

  .shadow-layout {
    grid-template-columns: 1fr;
  }

  .login-comparison {
    grid-template-columns: 1fr;
    height: auto;
  }

  .login-column {
    grid-template-rows: 72px 110px 110px;
  }

  .login-column + .login-column {
    border-left: 0;
    border-top: 1px solid var(--border-base);
  }

  .login-chart-card,
  .friction-card {
    width: 100%;
  }
}

@media (max-width: 900px) {
  .security-metrics {
    grid-template-columns: 1fr;
  }

  .shadow-metrics {
    grid-template-columns: 1fr;
  }

  .score-gauge {
    position: relative;
    top: auto;
    right: auto;
    margin: 24px auto 0;
  }

  .score-total,
  .score-distribution {
    min-height: auto;
  }

  .security-score-section {
    padding-bottom: 24px;
  }

  .friction-header {
    height: auto;
    min-height: 89px;
    flex-direction: column;
    gap: 12px;
  }

  .friction-header > div {
    max-width: 100%;
  }
}

@media (max-width: 760px) {
  .security-metrics {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }

  .shadow-metrics {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}