:root {
  --bg: #061729;
  --panel: #0f2238;
  --panel-2: #15263d;
  --border: #2a4363;
  --text: #eff6ff;
  --muted: #8fa7c1;
  --blue: #2997ff;
  --blue-2: #1a5dcc;
  --green: #57d97a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  background: radial-gradient(circle at top, #102b46, var(--bg) 60%);
  color: var(--text);
}

.wrapper {
  width: min(100% - 24px, 1920px);
  margin: 28px auto;
  padding: 0;
}

.dashboard {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 56px);
  border: 1px solid #1c3553;
  border-radius: 12px;
  overflow: hidden;
  background: #0b1d32;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: #1a2b43;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  height: 42px;
  display: flex;
  align-items: center;
}

.brand-logo {
  display: block;
  height: 100%;
  width: auto;
  max-width: 180px;
  object-fit: contain;
}

.brand h1 {
  margin: 0;
  font-size: 40px;
}

.user-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(180deg, #dfe5ec, #bac8d8);
  color: #18314c;
  font-size: 0.82rem;
  font-weight: 700;
}

.user-text small {
  display: block;
  color: var(--muted);
}

.user-text strong {
  display: block;
}

.logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  width: 34px;
  height: 34px;
  color: #fff;
  background: linear-gradient(180deg, #329eff, #1f61cc);
  cursor: pointer;
  text-decoration: none;
}

.content {
  display: grid;
  grid-template-columns: 54px 1fr;
  flex: 1;
  min-height: 0;
}

.left-rail {
  border-right: 1px solid var(--border);
  background: #1b2d45;
}

.main-panel {
  display: flex;
  flex-direction: column;
  padding: 18px;
  min-height: 0;
}

.summary-head h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.summary-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.cards-grid {
  margin-top: 18px;
  margin-bottom: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-content: start;
  flex: 1;
  gap: 12px;
}

.card {
  position: relative;
  min-height: 148px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, #182b44, #13253a);
  padding: 14px;
  container-type: inline-size;
}

.card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 10px;
  border-radius: 0 0 12px 12px;
  background: linear-gradient(90deg, var(--blue-2), #35b6ff);
}

.icon {
  font-size: 22px;
}

.card h3 {
  margin: 8px 0 10px;
  font-size: clamp(0.92rem, 8cqw, 1.12rem);
  line-height: 1.1;
  font-weight: 500;
}

.value {
  margin: 0;
  font-size: clamp(1.7rem, 16cqw, 2.875rem);
  font-weight: 700;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.value-title {
  margin: 8px 0 4px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.value + .value-title {
  margin-top: 12px;
}

.card-success::after {
  background: linear-gradient(90deg, #1c8b4a, #62dc89);
}

.success {
  color: var(--green);
}

.statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 48px;
  padding: 10px 20px;
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, #15263c 0%, #0f1d30 100%);
  font-size: 0.88rem;
  color: var(--muted);
}

.status-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 500;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background-color: var(--green);
  box-shadow: 0 0 8px rgba(87, 217, 122, 0.6);
  display: inline-block;
  position: relative;
  flex-shrink: 0;
}

.status-dot::after {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid var(--green);
  animation: pulse-ring 2.2s infinite ease-out;
  opacity: 0;
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.7);
    opacity: 0.85;
  }
  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

.company-name {
  letter-spacing: 0.01em;
}

.status-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.update-label {
  color: var(--muted);
}

.update-time {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.refresh-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: #1a2b43;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
}

.refresh-toggle:hover,
.refresh-toggle:focus-visible {
  border-color: var(--blue);
  background: #203b5d;
}

.refresh-toggle:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.status-version {
  color: var(--muted);
  font-size: 0.8rem;
  opacity: 0.7;
}

@media (max-width: 680px) {
  .statusbar {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: 8px;
    padding: 12px 16px;
  }

  .status-info {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 680px) {
  .content {
    grid-template-columns: 1fr;
  }

  .left-rail {
    min-height: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .cards-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}
