.cti-v1-legacy-page {
  min-height: calc(100vh - 40px);
  padding: 32px;
  color: #fff;
  border-radius: 22px;
  background:
    radial-gradient(circle at 78% 8%, rgba(59,130,246,.30), transparent 30%),
    radial-gradient(circle at 12% 88%, rgba(14,165,233,.18), transparent 26%),
    linear-gradient(180deg,#020617 0%,#0f172a 46%,#172554 100%);
  box-shadow: inset 0 0 0 1px rgba(59,130,246,.45);
}

.cti-v1-legacy-head {
  margin-bottom: 28px;
}

.cti-v1-legacy-head h2 {
  margin: 22px 0 10px;
  font-size: 42px;
  font-weight: 950;
  color: #fff;
  text-shadow: 0 6px 22px rgba(0,0,0,.45);
}

.cti-v1-legacy-head p {
  margin: 0;
  font-size: 17px;
  line-height: 1.5;
  color: #dbeafe;
}

.cti-v1-legacy-back {
  min-width: 220px;
}

.cti-v1-legacy-status {
  margin: 0 0 24px;
  padding: 20px 22px;
  border-radius: 18px;
  background: rgba(15,23,42,.74);
  border: 1px solid rgba(56,189,248,.34);
  box-shadow: 0 14px 30px rgba(0,0,0,.26);
}

.cti-v1-legacy-status h3 {
  margin: 0 0 12px;
  font-size: 23px;
  color: #fff;
}

.cti-v1-legacy-status p {
  margin: 8px 0 0;
  color: #dbeafe;
  line-height: 1.5;
}

.cti-v1-legacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  padding: 7px 12px;
  border-radius: 999px;
  font-weight: 900;
  color: #facc15;
  background: rgba(250,204,21,.12);
  border: 1px solid rgba(250,204,21,.45);
}

.cti-v1-legacy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(290px,1fr));
  gap: 24px;
}

.cti-v1-legacy-card {
  position: relative;
  min-height: 230px;
  border: 1px solid rgba(56,189,248,.78);
  border-radius: 24px;
  padding: 28px;
  color: #fff;
  text-align: left;
  cursor: pointer;
  background:
    radial-gradient(circle at 50% 0%, rgba(56,189,248,.26), transparent 34%),
    linear-gradient(180deg,#2563eb 0%,#1d4ed8 45%,#172554 100%);
  box-shadow: 0 18px 36px rgba(0,0,0,.32), 0 0 24px rgba(37,99,235,.22);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.cti-v1-legacy-card:hover {
  transform: translateY(-5px);
  border-color: rgba(125,211,252,1);
  box-shadow: 0 24px 46px rgba(0,0,0,.40), 0 0 34px rgba(56,189,248,.45);
}

.cti-v1-legacy-card::after {
  content: ">";
  position: absolute;
  right: 28px;
  bottom: 24px;
  font-size: 38px;
  font-weight: 900;
  color: #fff;
}

.cti-v1-legacy-icon {
  width: 92px;
  height: 92px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 26px;
  font-weight: 950;
  letter-spacing: .03em;
  color: #e0f2fe;
  background: radial-gradient(circle at 35% 25%, rgba(255,255,255,.22), rgba(37,99,235,.20));
  border: 2px solid rgba(56,189,248,.85);
  box-shadow:
    0 0 26px rgba(56,189,248,.55),
    inset 0 0 18px rgba(56,189,248,.20);
}

.cti-v1-legacy-card strong {
  display: block;
  font-size: 27px;
  margin-bottom: 14px;
}

.cti-v1-legacy-card span {
  display: block;
  font-size: 16px;
  line-height: 1.45;
  color: #e0f2fe;
}

.cti-v1-legacy-card small {
  display: block;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid rgba(125,211,252,.28);
  font-size: 15px;
  font-weight: 900;
  color: #facc15;
}

.cti-v1-legacy-detail {
  margin-top: 24px;
  padding: 22px;
  border-radius: 18px;
  background: rgba(15,23,42,.82);
  border: 1px solid rgba(56,189,248,.34);
  box-shadow: 0 14px 30px rgba(0,0,0,.26);
}

.cti-v1-legacy-detail h3 {
  margin: 0 0 12px;
  font-size: 24px;
  color: #fff;
}

.cti-v1-legacy-detail p {
  margin: 8px 0 0;
  color: #dbeafe;
  line-height: 1.55;
}

.cti-v1-legacy-detail strong {
  color: #fff;
}

@media (max-width: 720px) {
  .cti-v1-legacy-page {
    padding: 18px;
  }

  .cti-v1-legacy-head h2 {
    font-size: 32px;
  }

  .cti-v1-legacy-grid {
    grid-template-columns: 1fr;
  }

  .cti-v1-legacy-card {
    min-height: 190px;
  }
}
.cti-v1-legacy-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(190px,1fr));
  gap: 16px;
  margin: 0 0 24px;
}

.cti-v1-legacy-summary > div {
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(15,23,42,.78);
  border: 1px solid rgba(56,189,248,.34);
  box-shadow: 0 12px 26px rgba(0,0,0,.22);
}

.cti-v1-legacy-summary strong {
  display: block;
  font-size: 34px;
  line-height: 1;
  color: #fff;
  margin-bottom: 8px;
}

.cti-v1-legacy-summary span {
  display: block;
  font-size: 14px;
  color: #dbeafe;
  font-weight: 800;
}

.cti-v1-legacy-card-count {
  margin: -4px 0 12px;
  font-size: 36px;
  font-weight: 950;
  line-height: 1;
  color: #fff;
  text-shadow: 0 4px 16px rgba(0,0,0,.28);
}

.cti-v1-legacy-error {
  margin-top: 12px !important;
  color: #fecaca !important;
  font-weight: 900;
}

.cti-v1-legacy-mini-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(150px,1fr));
  gap: 12px;
  margin: 18px 0;
}

.cti-v1-legacy-mini-summary > div {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(30,64,175,.30);
  border: 1px solid rgba(125,211,252,.25);
}

.cti-v1-legacy-mini-summary strong {
  display: block;
  font-size: 26px;
  color: #fff;
  line-height: 1;
  margin-bottom: 6px;
}

.cti-v1-legacy-mini-summary span {
  color: #dbeafe;
  font-size: 13px;
  font-weight: 800;
}

.cti-v1-legacy-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 18px 0;
  border-radius: 16px;
  border: 1px solid rgba(56,189,248,.28);
}

.cti-v1-legacy-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
  background: rgba(15,23,42,.72);
}

.cti-v1-legacy-table th,
.cti-v1-legacy-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(125,211,252,.16);
  color: #e0f2fe;
  text-align: left;
  vertical-align: top;
}

.cti-v1-legacy-table th {
  color: #fff;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: rgba(30,64,175,.42);
}

.cti-v1-legacy-table code {
  color: #bfdbfe;
  white-space: nowrap;
}

.cti-v1-legacy-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.cti-v1-legacy-pill.green {
  color: #bbf7d0;
  background: rgba(22,163,74,.18);
  border: 1px solid rgba(34,197,94,.42);
}

.cti-v1-legacy-pill.gray {
  color: #e5e7eb;
  background: rgba(100,116,139,.20);
  border: 1px solid rgba(148,163,184,.38);
}

.cti-v1-legacy-script-row {
  cursor: pointer;
}

.cti-v1-legacy-script-row:hover td {
  background: rgba(56,189,248,.12);
}

.cti-v1-legacy-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(2,6,23,.78);
  backdrop-filter: blur(6px);
}

.cti-v1-legacy-modal {
  width: min(1180px, 96vw);
  max-height: 90vh;
  overflow: hidden;
  border-radius: 24px;
  background: linear-gradient(160deg, #071225 0%, #0f1d3a 52%, #102a60 100%);
  border: 1px solid rgba(56,189,248,.42);
  box-shadow: 0 30px 90px rgba(0,0,0,.62);
  color: #fff;
}

.cti-v1-legacy-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 26px;
  border-bottom: 1px solid rgba(125,211,252,.22);
  background: rgba(30,64,175,.26);
}

.cti-v1-legacy-modal-head h3 {
  margin: 0 0 6px;
  font-size: 26px;
}

.cti-v1-legacy-modal-head p {
  margin: 0;
  color: #dbeafe;
  font-weight: 800;
}

.cti-v1-legacy-modal-close {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(248,113,113,.55);
  background: rgba(127,29,29,.72);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  font-weight: 900;
}

.cti-v1-legacy-modal-body {
  padding: 22px 26px 26px;
  overflow: auto;
  max-height: calc(90vh - 98px);
}

.cti-v1-legacy-modal-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(180px,1fr));
  gap: 12px;
  margin: 0 0 18px;
}

.cti-v1-legacy-modal-summary > div {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(15,23,42,.62);
  border: 1px solid rgba(125,211,252,.24);
}

.cti-v1-legacy-modal-summary strong {
  display: block;
  font-size: 16px;
  color: #fff;
  word-break: break-word;
}

.cti-v1-legacy-modal-summary span {
  display: block;
  margin-top: 6px;
  color: #bfdbfe;
  font-size: 13px;
  font-weight: 900;
}

.cti-v1-legacy-modal h4 {
  margin: 22px 0 10px;
  font-size: 20px;
}

.cti-v1-legacy-modal-note {
  color: #bfdbfe;
  font-weight: 800;
  margin-top: 12px;
}

.cti-v1-legacy-modal-table {
  min-width: 920px;
}

.cti-v1-legacy-service-row {
  cursor: pointer;
}

.cti-v1-legacy-service-row:hover td {
  background: rgba(56,189,248,.12);
}

.cti-v1-legacy-agent-row {
  cursor: pointer;
}

.cti-v1-legacy-agent-row:hover td {
  background: rgba(56,189,248,.12);
}

/* CTI V1 Legacy - säkerhetsläge */
.cti-v1-security-panel {
  margin: 18px 0 22px 0;
  padding: 18px 20px;
  border: 1px solid rgba(255, 204, 0, 0.42);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(38, 55, 95, 0.94), rgba(11, 24, 54, 0.96));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.cti-v1-security-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.cti-v1-security-head h3 {
  margin: 10px 0 6px 0;
  font-size: 30px;
  line-height: 1;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.cti-v1-security-head p {
  margin: 0;
  color: #dbeafe;
  font-size: 15px;
  line-height: 1.45;
}

.cti-v1-security-badge {
  display: inline-flex;
  width: auto;
}

.cti-v1-security-state {
  flex: 0 0 auto;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 204, 0, 0.55);
  background: rgba(255, 204, 0, 0.14);
  color: #ffd400;
  font-weight: 900;
  white-space: nowrap;
}

.cti-v1-security-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.cti-v1-security-grid > div {
  padding: 14px 14px;
  border-radius: 14px;
  border: 1px solid rgba(77, 184, 255, 0.28);
  background: rgba(5, 15, 38, 0.42);
}

.cti-v1-security-grid strong {
  display: block;
  margin-bottom: 6px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
}

.cti-v1-security-grid span {
  display: block;
  color: #22c55e;
  font-size: 18px;
  font-weight: 900;
}

.cti-v1-security-grid > div:nth-child(2) span,
.cti-v1-security-grid > div:nth-child(3) span {
  color: #ffd400;
}

.cti-v1-security-note {
  margin-top: 14px;
  color: #c7d2fe;
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .cti-v1-security-head {
    display: block;
  }

  .cti-v1-security-state {
    display: inline-flex;
    margin-top: 12px;
  }

  .cti-v1-security-grid {
    grid-template-columns: 1fr;
  }
}
