:root {
  --bg: #050911;
  --panel: rgba(13, 22, 36, 0.88);
  --panel-2: rgba(18, 31, 50, 0.92);
  --line: rgba(91, 207, 255, 0.18);
  --line-strong: rgba(91, 207, 255, 0.36);
  --text: #ecf7ff;
  --muted: #8ca5bb;
  --blue: #2ac7ff;
  --blue-2: #0077ff;
  --green: #42f5a7;
  --yellow: #ffd166;
  --red: #ff5c7a;
  --orange: #ff9d4d;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;
  background:
    radial-gradient(circle at 15% 10%, rgba(0, 119, 255, .28), transparent 36%),
    radial-gradient(circle at 88% 14%, rgba(42, 199, 255, .18), transparent 33%),
    linear-gradient(135deg, #04070d 0%, #07101d 52%, #03060b 100%);
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }

.jkd-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
}

.jkd-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 18px;
  border-right: 1px solid var(--line);
  background: rgba(5, 9, 17, .72);
  backdrop-filter: blur(18px);
  overflow: auto;
}

.jkd-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(21, 36, 56, .92), rgba(9, 15, 27, .88));
  box-shadow: 0 18px 50px rgba(0, 119, 255, .08);
}

.jkd-brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: radial-gradient(circle, rgba(42, 199, 255, .38), rgba(0, 119, 255, .12));
  border: 1px solid rgba(42, 199, 255, .38);
  overflow: hidden;
}

.jkd-brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.jkd-brand-mark.fallback-mark::before { content: "JK"; font-weight: 900; letter-spacing: -0.06em; color: var(--blue); }
.jkd-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.jkd-brand-text strong { font-size: 1.02rem; }
.jkd-brand-text small { color: var(--muted); margin-top: 4px; }

.jkd-nav { display: grid; gap: 8px; margin-top: 22px; }
.jkd-nav a {
  padding: 13px 14px;
  border-radius: 15px;
  color: #c7d8e8;
  border: 1px solid transparent;
  transition: .18s ease;
}
.jkd-nav a:hover,
.jkd-nav a.active {
  color: #fff;
  border-color: var(--line-strong);
  background: linear-gradient(90deg, rgba(0, 119, 255, .22), rgba(42, 199, 255, .08));
  box-shadow: inset 3px 0 0 var(--blue);
}

.jkd-sidebar-card {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  border-radius: 18px;
  background: rgba(13, 22, 36, .72);
  border: 1px solid var(--line);
}
.jkd-sidebar-card strong { display: block; font-size: .93rem; }
.jkd-sidebar-card small { display: block; color: var(--muted); margin-top: 3px; }
.dot { width: 12px; height: 12px; border-radius: 99px; display: inline-block; box-shadow: 0 0 18px currentColor; }
.dot-demo { color: var(--green); background: var(--green); }

.jkd-main { padding: 26px; min-width: 0; }
.jkd-hero {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: flex-start;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(120deg, rgba(18, 31, 50, .96), rgba(5, 11, 21, .9)),
    radial-gradient(circle at right, rgba(42, 199, 255, .18), transparent 40%);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}
.jkd-hero::after {
  content: "";
  position: absolute;
  right: 22px;
  bottom: -88px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  border: 1px solid rgba(42, 199, 255, .22);
  box-shadow: inset 0 0 55px rgba(42, 199, 255, .08);
  pointer-events: none;
}
.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .72rem;
  color: var(--blue);
  font-weight: 800;
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(2rem, 4vw, 4.2rem); line-height: .94; letter-spacing: -0.06em; }
h2 { margin-bottom: 8px; letter-spacing: -0.035em; }
h3 { margin-bottom: 10px; }
.hero-text { max-width: 870px; color: #b7cadd; line-height: 1.65; margin-bottom: 0; }
.hero-status { position: relative; z-index: 1; min-width: 220px; text-align: right; }
.hero-status small { display: block; color: var(--muted); margin-top: 8px; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(10, 20, 34, .86);
  color: var(--muted);
  font-weight: 900;
}
.status-pill.ready { color: var(--green); border-color: rgba(66, 245, 167, .35); }
.status-pill.error { color: var(--red); border-color: rgba(255, 92, 122, .42); }
.status-pill.working { color: var(--yellow); border-color: rgba(255, 209, 102, .42); }

.jkd-stats {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.stat-card,
.search-panel,
.featured-panel,
.result-panel,
.detail-panel,
.detail-box,
.summary-card,
.checkplan-box,
.next-action-box,
.report-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 18px 55px rgba(0, 0, 0, .25);
}
.stat-card {
  padding: 18px;
  min-height: 112px;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: "";
  position: absolute;
  right: -35px;
  top: -35px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(42, 199, 255, .12);
}
.stat-label { display: block; color: var(--muted); font-size: .82rem; margin-bottom: 10px; }
.stat-card strong { display: block; font-size: 1.6rem; letter-spacing: -0.045em; }
.stat-card small { display: block; color: var(--muted); margin-top: 6px; }
.stat-card.warning strong { color: var(--yellow); }

.library-layout {
  margin-top: 20px;
  display: grid;
  grid-template-columns: minmax(360px, 520px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.library-left { display: grid; gap: 16px; }
.search-panel,
.featured-panel,
.result-panel,
.detail-panel { padding: 20px; }
.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.panel-header.slim { margin-bottom: 14px; }
.panel-header h2,
.panel-header h3 { margin-bottom: 0; }
.panel-header .eyebrow { margin-bottom: 5px; }

.search-grid {
  display: grid;
  grid-template-columns: 1fr 190px 150px;
  gap: 12px;
}
label span { display: block; color: #a9bbce; font-size: .83rem; margin-bottom: 7px; }
input, select {
  width: 100%;
  color: var(--text);
  background: rgba(3, 8, 16, .9);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  outline: none;
}
input:focus, select:focus { border-color: rgba(42, 199, 255, .72); box-shadow: 0 0 0 3px rgba(42, 199, 255, .09); }
select option { background: #07101d; color: var(--text); }
.btn {
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 11px 14px;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  transition: .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, var(--blue-2), var(--blue)); color: white; box-shadow: 0 14px 30px rgba(0, 119, 255, .25); }
.btn-ghost { background: rgba(8, 16, 28, .72); border-color: var(--line); color: #c7d8e8; }

.featured-codes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.featured-code {
  padding: 14px 12px;
  border-radius: 18px;
  border: 1px solid rgba(42, 199, 255, .24);
  background: linear-gradient(145deg, rgba(0, 119, 255, .14), rgba(15, 29, 49, .9));
  cursor: pointer;
  transition: .18s ease;
}
.featured-code:hover { transform: translateY(-2px); border-color: rgba(42, 199, 255, .56); }
.featured-code strong { display: block; color: var(--blue); font-size: 1.15rem; }
.featured-code small { display: block; color: var(--muted); margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.mini-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 11px;
  border-radius: 999px;
  color: var(--blue);
  border: 1px solid rgba(42, 199, 255, .22);
  background: rgba(42, 199, 255, .06);
  font-weight: 900;
  white-space: nowrap;
}
.fault-result-list { display: grid; gap: 10px; max-height: 60vh; overflow: auto; padding-right: 4px; }
.fault-card {
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 18px;
  padding: 15px;
  background: rgba(7, 15, 28, .74);
  cursor: pointer;
  transition: .16s ease;
}
.fault-card:hover,
.fault-card.active { border-color: rgba(42, 199, 255, .48); background: rgba(12, 30, 52, .88); transform: translateY(-1px); }
.fault-card-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.fault-code { color: var(--blue); font-weight: 950; font-size: 1.2rem; letter-spacing: .02em; }
.fault-title { font-weight: 900; font-size: 1.04rem; margin-top: 3px; }
.fault-card p { color: #abc0d4; line-height: 1.45; margin: 8px 0 0; }
.fault-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.priority-badge,
.tuv-badge,
.tiny-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 900;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .05);
}
.priority-hoch { color: var(--red); border-color: rgba(255, 92, 122, .34); background: rgba(255, 92, 122, .08); }
.priority-mittel { color: var(--yellow); border-color: rgba(255, 209, 102, .34); background: rgba(255, 209, 102, .08); }
.priority-niedrig { color: var(--green); border-color: rgba(66, 245, 167, .34); background: rgba(66, 245, 167, .08); }
.tuv-hoch { color: var(--orange); border-color: rgba(255, 157, 77, .38); }
.tuv-mittel { color: var(--yellow); border-color: rgba(255, 209, 102, .33); }
.tuv-niedrig { color: var(--muted); border-color: rgba(140, 165, 187, .25); }

.detail-panel { min-height: 700px; position: sticky; top: 26px; }
.detail-empty {
  min-height: 620px;
  display: grid;
  place-items: center;
  text-align: center;
  align-content: center;
  color: var(--muted);
}
.detail-empty h2 { color: var(--text); margin: 18px 0 8px; }
.detail-empty p { max-width: 460px; line-height: 1.6; }
.empty-orb {
  width: 126px;
  height: 126px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 2rem;
  font-weight: 950;
  color: var(--blue);
  background: radial-gradient(circle, rgba(42, 199, 255, .22), rgba(0, 119, 255, .06));
  border: 1px solid rgba(42, 199, 255, .25);
  box-shadow: 0 0 70px rgba(42, 199, 255, .16);
}
.hidden { display: none !important; }
.detail-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.detail-top h2 { font-size: clamp(1.7rem, 3vw, 3rem); margin: 0 0 8px; }
#detailCode { color: var(--blue); }
.detail-component { color: #a9bed2; margin: 0; }
.detail-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.summary-card { padding: 20px; background: linear-gradient(145deg, rgba(0, 119, 255, .14), rgba(11, 24, 41, .92)); border-color: rgba(42, 199, 255, .24); }
.summary-card p,
.detail-box p,
.next-action-box p,
.report-box p { color: #c1d4e6; line-height: 1.65; margin-bottom: 0; }
.detail-grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.detail-box,
.checkplan-box,
.next-action-box,
.report-box { padding: 18px; }
.customer-box { border-color: rgba(66, 245, 167, .2); }
.clean-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.clean-list li {
  padding-left: 20px;
  position: relative;
  color: #c1d4e6;
  line-height: 1.45;
}
.clean-list li::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
  position: absolute;
  left: 0;
  top: .55em;
  box-shadow: 0 0 12px rgba(42, 199, 255, .8);
}
.checkplan-box,
.next-action-box,
.report-box { margin-top: 14px; }
.check-list { display: grid; gap: 12px; }
.check-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(3, 8, 16, .42);
}
.check-step {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  font-weight: 950;
  background: linear-gradient(135deg, var(--blue-2), var(--blue));
}
.check-item h4 { margin: 0 0 7px; }
.check-item p { margin: 4px 0 0; color: #adc1d4; line-height: 1.45; }
.check-item strong { color: #fff; }
.chip-list { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 10px;
  background: rgba(42, 199, 255, .08);
  border: 1px solid rgba(42, 199, 255, .18);
  color: #c9e9ff;
  font-size: .84rem;
  font-weight: 750;
}
.report-box { border-color: rgba(66, 245, 167, .24); background: rgba(10, 28, 28, .56); }
.report-box .btn { margin-top: 14px; }
.next-action-box { border-color: rgba(255, 209, 102, .24); background: rgba(31, 25, 10, .42); }
.empty-results {
  padding: 28px;
  border-radius: 18px;
  text-align: center;
  color: var(--muted);
  background: rgba(3, 8, 16, .4);
  border: 1px dashed var(--line);
}

@media (max-width: 1220px) {
  .jkd-shell { grid-template-columns: 1fr; }
  .jkd-sidebar { position: relative; height: auto; }
  .jkd-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .library-layout { grid-template-columns: 1fr; }
  .detail-panel { position: relative; top: auto; }
}

@media (max-width: 760px) {
  .jkd-main { padding: 14px; }
  .jkd-hero { flex-direction: column; padding: 22px; }
  .hero-status { text-align: left; min-width: 0; }
  .jkd-stats { grid-template-columns: 1fr 1fr; }
  .jkd-nav { grid-template-columns: 1fr; }
  .search-grid { grid-template-columns: 1fr; }
  .featured-codes { grid-template-columns: 1fr; }
  .detail-grid-two { grid-template-columns: 1fr; }
  .detail-top { flex-direction: column; }
  .detail-badges { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
}
