@font-face {
  font-family: 'Lato';
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/Lato-Regular.woff2) format('woff2');
}

@font-face {
  font-family: 'Lato';
  font-weight: 600;
  font-display: swap;
  src: url(/fonts/Lato-Semibold.woff2) format('woff2');
}

@font-face {
  font-family: 'Lato';
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/Lato-Bold.woff2) format('woff2');
}

/* палитра из frontend/tailwind.config.js основного приложения */
:root {
  --accent: #0AC9C4;
  --bg: #F9F9FB;
  --surface: #FFFFFF;
  --text: #1E293B;
  --muted: #7C8499;
  --border: #E6E8F0;
  --empty: #E2E5EE;

  --up: #1FA971;
  --up-bg: #E7F7F0;
  --warn: #F2A93B;
  --down: #E5484D;
  --down-bg: #FDECEC;
  --unknown: #ACB1C2;
  --unknown-bg: #F3F4F9;

  --shadow: 0 1px 2px rgba(30, 41, 59, .04), 0 4px 16px rgba(30, 41, 59, .04);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F141C;
    --surface: #171E29;
    --text: #E8ECF3;
    --muted: #8C95A8;
    --border: #263040;
    --empty: #2A3444;

    --up: #34C68A;
    --up-bg: #12301F;
    --down: #F26B6F;
    --down-bg: #3A1A1C;
    --unknown-bg: #1E2633;

    --shadow: none;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/21px 'Lato', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 16px;
}

.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
}

.header__logo {
  display: flex;
}

.header__logo img {
  display: block;
  height: 24px;
  width: auto;
}

.header__title {
  padding-left: 16px;
  border-left: 1px solid var(--border);
  color: var(--muted);
  font-size: 16px;
  line-height: 24px;
}

.banner {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 32px 0 24px;
  padding: 20px 24px;
  border-radius: 12px;
  background: var(--unknown-bg);
}

.banner--up {
  background: var(--up-bg);
}

.banner--down {
  background: var(--down-bg);
}

.banner__icon {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--unknown) center / 20px no-repeat;
}

.banner--up .banner__icon {
  background-color: var(--up);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 10.5l3.5 3.5 7.5-8'/%3E%3C/svg%3E");
}

.banner--down .banner__icon {
  background-color: var(--down);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M10 4.5v6.5M10 14.8v.2'/%3E%3C/svg%3E");
}

.banner__title {
  margin: 0;
  font-size: 21px;
  line-height: 28px;
  font-weight: 700;
}

.banner__subtitle {
  margin: 2px 0 0;
  color: var(--muted);
}

.groups {
  display: grid;
  gap: 12px;
}

.group {
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.group__name {
  margin: 0;
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
}

.group__desc {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--unknown-bg);
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  white-space: nowrap;
}

.pill::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.pill--up {
  background: var(--up-bg);
  color: var(--up);
}

.pill--down {
  background: var(--down-bg);
  color: var(--down);
}

.pill--down::before {
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    opacity: .35;
  }
}

.bars {
  display: flex;
  gap: 2px;
  height: 32px;
  margin-top: 16px;
}

.bar {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 2px;
  background: var(--empty);
}

.bar--up {
  background: var(--up);
}

.bar--warn {
  background: var(--warn);
}

.bar--down {
  background: var(--down);
}

.bar:hover {
  opacity: .7;
}

.group__foot {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

.group__uptime {
  color: var(--text);
  font-weight: 600;
}

.section-title {
  margin: 40px 0 12px;
  font-size: 18px;
  line-height: 24px;
  font-weight: 700;
}

.incidents__list {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.incident {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
}

.incident + .incident {
  border-top: 1px solid var(--border);
}

.incident__group {
  font-weight: 600;
}

.incident__group::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--unknown);
}

.incident--open .incident__group::before {
  background: var(--down);
}

.incident__time {
  color: var(--muted);
  text-align: right;
}

.incidents__empty {
  padding: 20px 24px;
  color: var(--muted);
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  margin-top: 32px;
  padding-bottom: 40px;
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

.tooltip {
  position: fixed;
  z-index: 10;
  padding: 6px 10px;
  border-radius: 8px;
  background: #1E293B;
  color: #fff;
  font-size: 12px;
  line-height: 16px;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 8px));
}

.tooltip b {
  display: block;
  font-weight: 600;
}

@media (max-width: 600px) {
  .header__title {
    font-size: 14px;
  }

  .banner {
    margin-top: 20px;
    padding: 16px;
  }

  .banner__title {
    font-size: 18px;
    line-height: 24px;
  }

  .group {
    padding: 16px;
  }

  /* на узком экране показываем последние 30 дней */
  .bar:nth-last-child(n+31) {
    display: none;
  }

  .bars {
    gap: 3px;
  }

  .incident {
    flex-direction: column;
    gap: 2px;
    padding: 12px 16px;
  }

  .incident__time {
    text-align: left;
  }
}
