:root {
  --bg: #040b0f;
  --surface: #071217;
  --panel: rgba(11, 27, 34, 0.92);
  --panel-strong: rgba(15, 36, 45, 0.96);
  --panel-soft: rgba(255, 255, 255, 0.035);
  --line: rgba(166, 214, 224, 0.16);
  --line-strong: rgba(166, 214, 224, 0.28);
  --text: #f4f8fb;
  --muted: #9eb1ba;
  --faint: #6f828a;
  --cyan: #67d9f7;
  --green: #26d895;
  --green-deep: #0e7d66;
  --red: #ff5f75;
  --amber: #ffd166;
  --blue: #7fb4ff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  --radius: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--text);
  font-family: Inter, "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  background:
    linear-gradient(90deg, rgba(92, 26, 38, 0.28), transparent 18%, transparent 78%, rgba(15, 117, 103, 0.26)),
    linear-gradient(180deg, #051014 0%, #071419 46%, #03080b 100%);
}

.page-shell {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.page-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.92), transparent 92%);
}

.page-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 65, 95, 0.12), transparent 20%, transparent 80%, rgba(38, 216, 149, 0.13)),
    radial-gradient(circle at 22% 8%, rgba(103, 217, 247, 0.14), transparent 24%),
    radial-gradient(circle at 86% 12%, rgba(38, 216, 149, 0.12), transparent 22%);
  filter: blur(2px);
}

.container {
  position: relative;
  z-index: 1;
  width: min(1480px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  min-height: 154px;
  margin-bottom: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(8, 19, 25, 0.94), rgba(5, 13, 18, 0.96)),
    var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 0;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--red), var(--cyan), var(--green));
}

.hero-copy,
.hero-actions {
  position: relative;
  z-index: 1;
}

.hero-copy {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}

.hero-copy::before {
  content: "";
  width: 184px;
  height: 64px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  background:
    url("https://analytics.liontrans.kg/assets/logo/lion-trans-full-white.png") center / 148px auto no-repeat,
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.03)),
    #14242b;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.hero-copy > * {
  grid-column: 2;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(38, 216, 149, 0.28);
  border-radius: 999px;
  background: rgba(38, 216, 149, 0.1);
  color: #b7ffe7;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 12px 0 8px;
  max-width: 780px;
  font-size: clamp(32px, 3.4vw, 50px);
  line-height: 1.02;
  letter-spacing: 0;
  font-weight: 950;
}

.subtitle {
  margin: 0;
  max-width: 820px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
}

.refresh-btn,
.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, opacity 0.16s ease;
}

.refresh-btn {
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(103, 217, 247, 0.5);
  border-radius: 12px;
  color: #031116;
  font-weight: 900;
  background: linear-gradient(135deg, #baf2ff, #67d9f7 56%, #38bdf8);
  box-shadow: 0 18px 34px rgba(56, 189, 248, 0.2);
}

.refresh-btn:hover,
.btn:hover {
  transform: translateY(-1px);
}

.refresh-btn:disabled,
.btn:disabled {
  opacity: 0.68;
  cursor: wait;
  transform: none;
}

.refresh-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.summary-card {
  position: relative;
  min-height: 104px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(11, 27, 34, 0.72);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.summary-card::before {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  top: 0;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--green));
}

.summary-card:nth-child(2)::before {
  background: linear-gradient(90deg, var(--amber), #ffefb4);
}

.summary-card:nth-child(3)::before {
  background: linear-gradient(90deg, var(--red), #ffb2bf);
}

.summary-card:nth-child(4)::before {
  background: linear-gradient(90deg, var(--blue), var(--cyan));
}

.summary-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.summary-value {
  display: block;
  margin-top: 12px;
  font-size: 38px;
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 950;
}

.erp-board {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.erp-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(15, 36, 45, 0.88), rgba(7, 18, 24, 0.94)),
    var(--panel);
  box-shadow: var(--shadow);
  padding: 18px;
  overflow: hidden;
}

.erp-card-main {
  grid-column: span 12;
}

.erp-board .erp-card:not(.erp-card-main) {
  grid-column: span 4;
  min-height: 308px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-head.compact {
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.section-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.eyebrow.mini {
  min-height: 24px;
  padding: 0 9px;
  font-size: 10px;
}

.panel-stamp {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

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

.erp-kpi {
  min-height: 108px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.04);
}

.erp-kpi span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.erp-kpi strong {
  display: block;
  margin-top: 14px;
  font-size: 42px;
  line-height: 1;
  letter-spacing: -0.05em;
  font-weight: 950;
}

.erp-kpi.danger strong {
  color: var(--red);
}

.bar-list,
.focus-list {
  display: grid;
  gap: 10px;
  align-content: start;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(120px, 1.1fr) 46px;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.035);
}

.bar-row.top-risk {
  border-color: rgba(255, 95, 117, 0.42);
  background: rgba(255, 95, 117, 0.075);
}

.bar-meta strong {
  display: block;
  font-size: 14px;
  line-height: 1.25;
}

.bar-meta span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--green));
}

.top-risk .bar-track span {
  background: linear-gradient(90deg, var(--red), var(--amber));
}

.bar-row b {
  justify-self: end;
  font-size: 18px;
}

.focus-item {
  display: block;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  text-decoration: none;
}

.focus-item strong,
.focus-item span {
  display: block;
}

.focus-item strong {
  font-size: 14px;
  line-height: 1.25;
}

.focus-item span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.focus-item.danger {
  border-color: rgba(255, 95, 117, 0.38);
  background: rgba(255, 95, 117, 0.08);
}

.focus-item.warning {
  border-color: rgba(255, 209, 102, 0.38);
  background: rgba(255, 209, 102, 0.08);
}

.empty-state {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 13px;
  color: var(--muted);
  text-align: center;
}

.skeleton-line {
  height: 54px;
  border-radius: 13px;
  background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.1), rgba(255,255,255,.05));
}

.skeleton-line.short {
  width: 76%;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  align-items: stretch;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  grid-column: span 4;
  min-height: 334px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(15, 36, 45, 0.9), rgba(7, 18, 24, 0.94)),
    var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
  isolation: isolate;
}

.card::before {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  top: 0;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--green));
  opacity: 0.95;
}

.card::after {
  content: "";
  position: absolute;
  right: -46px;
  bottom: -70px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: rgba(103, 217, 247, 0.12);
  filter: blur(26px);
  z-index: 0;
}

.grid .card:nth-child(3)::before {
  background: linear-gradient(90deg, var(--amber), var(--cyan));
}

.grid .card:nth-child(5)::before {
  background: linear-gradient(90deg, var(--red), var(--amber));
}

.grid .card:nth-child(6)::before {
  background: linear-gradient(90deg, #9a7cff, #f0abfc);
}

.card > * {
  position: relative;
  z-index: 1;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}

.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04));
  font-size: 25px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.status-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 16px currentColor;
}

.is-checking {
  color: #d6dee7;
  background: rgba(214, 222, 231, 0.1);
  border-color: rgba(214, 222, 231, 0.18);
}

.is-online {
  color: #b8ffe8;
  background: rgba(38, 216, 149, 0.12);
  border-color: rgba(38, 216, 149, 0.28);
}

.is-warn {
  color: #ffe7ad;
  background: rgba(255, 209, 102, 0.12);
  border-color: rgba(255, 209, 102, 0.3);
}

.is-down {
  color: #ffc6cf;
  background: rgba(255, 95, 117, 0.12);
  border-color: rgba(255, 95, 117, 0.32);
}

.card h2 {
  margin: 16px 0 0;
  min-height: 54px;
  font-size: 24px;
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 950;
}

.card-copy {
  margin: 0;
  min-height: 70px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #d8e8ed;
  background: rgba(255, 255, 255, 0.05);
  font-size: 12px;
  font-weight: 800;
}

.status-box {
  margin-top: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.status-line {
  font-size: 14px;
  font-weight: 900;
  line-height: 1.4;
}

.status-detail {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  word-break: break-word;
}

code {
  color: #c9f5ff;
  font-family: Consolas, "SFMono-Regular", monospace;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  font-weight: 900;
}

.btn-primary {
  color: #031116;
  background: linear-gradient(135deg, #b9f4ff, #67d9f7 56%, #28d895);
  border-color: rgba(103, 217, 247, 0.42);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.035);
}

.btn-ghost:hover {
  border-color: var(--line-strong);
}

@media (max-width: 1220px) {
  .erp-board .erp-card:not(.erp-card-main) {
    grid-column: span 6;
  }

  .erp-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card,
  .card:nth-child(n) {
    grid-column: span 6;
  }
}

@media (max-width: 920px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    grid-template-columns: 1fr;
  }

  .hero-copy::before {
    width: 172px;
  }

  .hero-copy > * {
    grid-column: 1;
  }

  .hero-actions {
    align-items: stretch;
  }

  .refresh-note {
    text-align: left;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-head {
    flex-direction: column;
  }
}

@media (max-width: 680px) {
  .container {
    width: min(100vw - 18px, 1480px);
    padding: 14px 0 38px;
  }

  .hero,
  .summary-card,
  .card {
    border-radius: 16px;
  }

  h1 {
    font-size: 34px;
  }

  .summary-grid,
  .grid {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .erp-board {
    grid-template-columns: 1fr;
  }

  .erp-card-main,
  .erp-board .erp-card:not(.erp-card-main) {
    grid-column: span 1;
  }

  .erp-kpis {
    grid-template-columns: 1fr;
  }

  .bar-row {
    grid-template-columns: 1fr;
  }

  .bar-row b {
    justify-self: start;
  }

  .card,
  .card:nth-child(n) {
    grid-column: span 1;
  }

  .card-actions {
    grid-template-columns: 1fr;
  }
}
