:root {
  --cyan: #00d4ff;
  --purple: #7c3aed;
  --dark: #050b18;
}
* {
  box-sizing: border-box;
}

body {
  background-color: var(--dark);
  color: #e2e8f0;
  min-height: 100vh;
}

/* Сетка фона */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* Радиальные засветки */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(
      ellipse at 15% 40%,
      rgba(0, 212, 255, 0.04) 0%,
      transparent 55%
    ),
    radial-gradient(
      ellipse at 85% 60%,
      rgba(124, 58, 237, 0.04) 0%,
      transparent 55%
    );
  pointer-events: none;
  z-index: 0;
}

.nav-glass {
  background: rgba(5, 11, 24, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0, 212, 255, 0.12);
}

.glass-card {
  background: rgba(10, 20, 40, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 212, 255, 0.18);
  border-radius: 16px;
}

.glow-logo {
  color: var(--cyan);
  font-family: "Courier New", monospace;
  font-weight: 700;
  text-shadow: 0 0 20px rgba(0, 212, 255, 0.45);
  letter-spacing: 0.05em;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00ff88;
  box-shadow:
    0 0 8px rgba(0, 255, 136, 0.9),
    0 0 16px rgba(0, 255, 136, 0.4);
  animation: blink 2.5s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

.pro-badge {
  background: linear-gradient(
    135deg,
    rgba(0, 212, 255, 0.15),
    rgba(124, 58, 237, 0.15)
  );
  border: 1px solid rgba(0, 212, 255, 0.35);
  color: var(--cyan);
  font-family: "Courier New", monospace;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 99px;
  letter-spacing: 0.08em;
}

.btn-nav {
  background: linear-gradient(
    135deg,
    rgba(0, 212, 255, 0.12),
    rgba(124, 58, 237, 0.12)
  );
  border: 1px solid rgba(0, 212, 255, 0.3);
  color: var(--cyan);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
}
.btn-nav:hover {
  background: linear-gradient(
    135deg,
    rgba(0, 212, 255, 0.22),
    rgba(124, 58, 237, 0.22)
  );
  box-shadow: 0 0 16px rgba(0, 212, 255, 0.2);
  border-color: rgba(0, 212, 255, 0.55);
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: #050b18;
  font-weight: 700;
  padding: 7px 18px;
  border-radius: 8px;
  font-size: 13px;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
  border: none;
  cursor: pointer;
}
.btn-primary:hover {
  box-shadow: 0 0 24px rgba(0, 212, 255, 0.35);
  transform: translateY(-1px);
}

.input-cyber {
  width: 100%;
  background: rgba(0, 212, 255, 0.04);
  border: 1px solid rgba(0, 212, 255, 0.2);
  color: #e2e8f0;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  outline: none;
}
.input-cyber:focus {
  border-color: rgba(0, 212, 255, 0.55);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.12);
}
.input-cyber::placeholder {
  color: rgba(148, 163, 184, 0.4);
}

.label-cyber {
  display: block;
  font-family: "Courier New", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(0, 212, 255, 0.7);
  margin-bottom: 6px;
}

.btn-submit {
  width: 100%;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: #050b18;
  font-weight: 700;
  font-family: "Courier New", monospace;
  letter-spacing: 0.1em;
  padding: 13px;
  border-radius: 10px;
  font-size: 13px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-submit:hover {
  box-shadow: 0 0 28px rgba(0, 212, 255, 0.35);
  transform: translateY(-1px);
}

.alert-error {
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.28);
  color: #fca5a5;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
}
.alert-success {
  background: rgba(0, 255, 136, 0.06);
  border: 1px solid rgba(0, 255, 136, 0.25);
  color: #6ee7b7;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
}
.alert-info {
  background: rgba(0, 212, 255, 0.06);
  border: 1px solid rgba(0, 212, 255, 0.22);
  color: #67e8f9;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
}

.divider-cyber {
  border: none;
  border-top: 1px solid rgba(0, 212, 255, 0.1);
  margin: 20px 0;
}

.page-title {
  font-family: "Courier New", monospace;
  color: var(--cyan);
  letter-spacing: 0.05em;
}

.mono {
  font-family: "Courier New", monospace;
}

/* Заставляем Chart.js и другие элементы перекрывать фон */
main {
  position: relative;
  z-index: 1;
}
nav {
  position: relative;
  z-index: 10;
}
footer {
  position: relative;
  z-index: 1;
}

/* Глобальные стили для всех форм Django */
input[type="text"],
input[type="url"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  background: rgba(0, 212, 255, 0.04);
  border: 1px solid rgba(0, 212, 255, 0.2);
  color: #e2e8f0;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  width: 100%;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  -webkit-appearance: none;
}
input[type="text"]:focus,
input[type="url"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  border-color: rgba(0, 212, 255, 0.55);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.12);
}
input::placeholder,
textarea::placeholder {
  color: rgba(148, 163, 184, 0.4);
}
select option {
  background: #0d1b2e;
  color: #e2e8f0;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--cyan);
  cursor: pointer;
}

.monitor-card {
  background: rgba(10, 20, 40, 0.75);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.monitor-card:hover,
.monitor-card:focus-within {
  border-color: rgba(0, 212, 255, 0.35);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.07);
}
.monitor-card-link {
  font-size: 14px;
  font-weight: 600;
  color: #e2e8f0;
  text-decoration: none;
  transition: color 0.2s;
}
.monitor-card-link:hover,
.monitor-card-link:focus {
  color: var(--cyan);
  outline: none;
}
.monitor-card-delete {
  font-size: 13px;
  color: rgba(248, 113, 113, 0.4);
  text-decoration: none;
  transition: color 0.2s;
  padding: 4px;
}
.monitor-card-delete:hover,
.monitor-card-delete:focus {
  color: #f87171;
  outline: none;
}

.nav-link-muted {
  font-size: 13px;
  color: rgba(148, 163, 184, 0.55);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-link-muted:hover,
.nav-link-muted:focus {
  color: #e2e8f0;
  outline: none;
}

.footer-legal-link {
  font-size: 11px;
  color: rgba(100, 116, 139, 0.45);
  text-decoration: none;
  font-family: "Courier New", monospace;
  letter-spacing: 0.05em;
  transition: color 0.2s;
}
.footer-legal-link:hover,
.footer-legal-link:focus {
  color: rgba(0, 212, 255, 0.6);
  outline: none;
}

.cookie-btn-accept {
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: #050b18;
  font-weight: 700;
  font-family: "Courier New", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: box-shadow 0.2s;
}
.cookie-btn-accept:hover,
.cookie-btn-accept:focus {
  box-shadow: 0 0 18px rgba(0, 212, 255, 0.35);
  outline: none;
}

.cookie-btn-required {
  background: transparent;
  color: rgba(148, 163, 184, 0.6);
  font-family: "Courier New", monospace;
  font-size: 11px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.cookie-btn-required:hover,
.cookie-btn-required:focus {
  border-color: rgba(148, 163, 184, 0.35);
  color: rgba(226, 232, 240, 0.8);
  outline: none;
}

[x-cloak] {
  display: none !important;
}

/* ── Nav avatar & dropdown ─────────────────────────────────────────────── */
.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.18), rgba(124, 58, 237, 0.18));
  border: 1px solid rgba(0, 212, 255, 0.35);
  color: var(--cyan);
  font-family: "Courier New", monospace;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  user-select: none;
}
.nav-avatar:hover {
  border-color: rgba(0, 212, 255, 0.65);
  box-shadow: 0 0 14px rgba(0, 212, 255, 0.25);
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: rgba(5, 11, 24, 0.97);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 12px;
  padding: 6px;
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 212, 255, 0.04);
  z-index: 100;
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: rgba(226, 232, 240, 0.75);
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
}
.nav-dropdown-item:hover,
.nav-dropdown-item:focus {
  background: rgba(0, 212, 255, 0.07);
  color: #e2e8f0;
  outline: none;
}
.nav-dropdown-item.danger:hover,
.nav-dropdown-item.danger:focus {
  background: rgba(248, 113, 113, 0.07);
  color: #fca5a5;
}

.nav-dropdown-divider {
  height: 1px;
  background: rgba(0, 212, 255, 0.08);
  margin: 4px 0;
}

/* ── Status badges ─────────────────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: "Courier New", monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 99px;
  white-space: nowrap;
}
.status-badge-up {
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid rgba(0, 255, 136, 0.3);
  color: #4ade80;
}
.status-badge-down {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: #f87171;
}
.status-badge-unknown {
  background: rgba(148, 163, 184, 0.07);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: rgba(148, 163, 184, 0.55);
}

/* ── Monitor card hover actions ────────────────────────────────────────── */
.monitor-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}
.monitor-card:hover .monitor-card-actions,
.monitor-card:focus-within .monitor-card-actions {
  opacity: 1;
}

.card-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: none;
  text-decoration: none;
  font-size: 13px;
  transition: all 0.15s;
  cursor: pointer;
  color: rgba(148, 163, 184, 0.45);
}
.card-action-btn:hover,
.card-action-btn:focus {
  outline: none;
}
.card-action-btn.edit:hover,
.card-action-btn.edit:focus {
  background: rgba(0, 212, 255, 0.08);
  border-color: rgba(0, 212, 255, 0.25);
  color: var(--cyan);
}
.card-action-btn.delete:hover,
.card-action-btn.delete:focus {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.25);
  color: #f87171;
}

/* ── Uptime display ────────────────────────────────────────────────────── */
.uptime-percent {
  font-family: "Courier New", monospace;
  font-size: 13px;
  font-weight: 700;
  color: #4ade80;
}
.uptime-percent.warn {
  color: #fbbf24;
}
.uptime-percent.crit {
  color: #f87171;
}

/* ── Telegram prompt banner ────────────────────────────────────────────── */
.tg-prompt {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 11px 14px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 10px;
  font-size: 12px;
  color: rgba(251, 191, 36, 0.9);
}
.tg-prompt a {
  color: #fbbf24;
  font-weight: 700;
  text-decoration: none;
}
.tg-prompt a:hover {
  text-decoration: underline;
}

/* ── Profile sections ──────────────────────────────────────────────────── */
.profile-section-title {
  font-family: "Courier New", monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: rgba(0, 212, 255, 0.5);
  text-transform: uppercase;
  margin-bottom: 14px;
}

/* ── Tooltip ────────────────────────────────────────────────────────────── */
.tooltip-wrap {
  position: relative;
  display: inline-flex;
}
.tooltip-wrap .tooltip-text {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(5, 11, 24, 0.97);
  border: 1px solid rgba(0, 212, 255, 0.2);
  color: rgba(226, 232, 240, 0.85);
  font-size: 11px;
  padding: 5px 9px;
  border-radius: 6px;
  white-space: nowrap;
  transition: opacity 0.15s;
  z-index: 50;
}
.tooltip-wrap:hover .tooltip-text,
.tooltip-wrap:focus-within .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* ── HTMX request indicator ─────────────────────────────────────────────── */
#htmx-indicator {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  z-index: 9999;
  animation: htmx-slide 1.2s ease-in-out infinite;
}
.htmx-request #htmx-indicator,
.htmx-request#htmx-indicator {
  display: block;
}
@keyframes htmx-slide {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

/* ── btn-cancel ──────────────────────────────────────────────────────────── */
.btn-cancel {
  padding: 13px 20px;
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: 10px;
  font-size: 13px;
  color: rgba(148, 163, 184, 0.6);
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: "Courier New", monospace;
  display: inline-block;
}
.btn-cancel:hover,
.btn-cancel:focus {
  border-color: rgba(0, 212, 255, 0.3);
  color: #e2e8f0;
  outline: none;
}
