:root {
  --bg-1: #07111f;
  --bg-2: #091b30;
  --panel: rgba(7, 23, 41, 0.78);
  --line: rgba(0, 229, 255, 0.35);
  --text: #dbfaff;
  --muted: #86a7b5;
  --accent: #00e5ff;
  --accent-2: #00ffa7;
  --danger: #ff5d7a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Rajdhani", "Exo 2", "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 20% 20%, #153f69, var(--bg-1) 45%),
    radial-gradient(circle at 85% 10%, #124f44, var(--bg-2) 35%),
    #030a12;
  min-height: 100vh;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(0, 229, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.08) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
  z-index: -1;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand h1 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.brand p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.brand-glow {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 18px var(--accent);
}

nav a {
  color: var(--text);
  text-decoration: none;
  margin-left: 0.8rem;
  font-weight: 600;
  border: 1px solid transparent;
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
}

nav a:hover {
  border-color: var(--line);
  color: var(--accent);
}

.container {
  max-width: 1180px;
  margin: 1.3rem auto 2rem;
  padding: 0 1rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: inset 0 0 0 1px rgba(3, 170, 189, 0.12), 0 12px 36px rgba(0, 0, 0, 0.35);
}

.section-title h2 {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 1.1rem;
}

.section-title p {
  margin: 0.3rem 0 0.9rem;
  color: var(--muted);
}

.flash-wrap {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.flash {
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
}

.flash.success {
  border-color: rgba(0, 255, 167, 0.5);
}

.flash.error {
  border-color: rgba(255, 93, 122, 0.55);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.8rem;
}

.service-card,
.empty-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.9rem;
  background: rgba(5, 22, 38, 0.8);
  transition: border-color 0.3s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.service-card.up {
  border-color: rgba(0, 255, 167, 0.5);
}

.service-card.down {
  border-color: rgba(255, 93, 122, 0.65);
}

.service-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 229, 255, 0.12);
}

.service-card.up::after,
.service-card.down::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-left: 0.45rem;
  vertical-align: middle;
  animation: pulse 1.8s infinite;
}

.service-card.up::after {
  background: var(--accent-2);
  box-shadow: 0 0 12px rgba(0, 255, 167, 0.75);
}

.service-card.down::after {
  background: var(--danger);
  box-shadow: 0 0 12px rgba(255, 93, 122, 0.75);
}

.service-card.status-changed {
  animation: blinkEdge 1.1s ease;
}

.service-card h3 {
  margin: 0 0 0.2rem;
}

.service-url {
  color: var(--accent);
  font-size: 0.9rem;
  word-break: break-all;
}

.service-meta {
  margin-top: 0.6rem;
  display: grid;
  gap: 0.2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.error-message {
  margin-top: 0.6rem;
  color: #ffc7d2;
  font-size: 0.9rem;
}

.error-message:empty {
  display: none;
}

.incident-list,
.event-list {
  display: grid;
  gap: 0.5rem;
}

.notice-list {
  display: grid;
  gap: 0.6rem;
}

.notice-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem;
  background: rgba(3, 19, 32, 0.75);
}

.notice-card h4 {
  margin: 0 0 0.2rem;
}

.notice-card p {
  margin: 0.35rem 0;
}

.notice-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

.notice-card.maintenance {
  border-color: rgba(255, 187, 0, 0.65);
}

.notice-card.incident {
  border-color: rgba(255, 93, 122, 0.65);
}

.notice-card.info {
  border-color: rgba(0, 229, 255, 0.45);
}

.admin-notice-list {
  margin-top: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.admin-edit {
  display: grid;
  gap: 0.5rem;
}

.notice-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notice-updates {
  margin-top: 0.5rem;
  display: grid;
  gap: 0.45rem;
}

.notice-updates h5 {
  margin: 0.2rem 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.notice-update-item {
  border: 1px solid rgba(0, 229, 255, 0.2);
  background: rgba(3, 19, 32, 0.5);
  border-radius: 8px;
  padding: 0.45rem 0.5rem;
}

.notice-update-item p {
  margin: 0.25rem 0 0;
}

.notice-update-item.empty {
  color: var(--muted);
}

.notice-update-form {
  display: grid;
  gap: 0.4rem;
}

.incident-card,
.event-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.6rem;
  background: rgba(3, 19, 32, 0.75);
}

.incident-card.resolved {
  border-color: rgba(0, 255, 167, 0.45);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid rgba(0, 229, 255, 0.15);
  padding: 0.55rem;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
}

.status-pill {
  display: inline-block;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 0.2rem 0.55rem;
  font-weight: 700;
  font-size: 0.8rem;
}

.status-pill.up {
  border-color: rgba(0, 255, 167, 0.55);
  color: var(--accent-2);
}

.status-pill.down {
  border-color: rgba(255, 93, 122, 0.65);
  color: #ff8ba0;
}

.status-pill.up,
.status-pill.down {
  animation: pulse 2s infinite;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

button,
.button-link {
  border: 1px solid var(--line);
  background: rgba(0, 229, 255, 0.12);
  color: var(--text);
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}

button:hover,
.button-link:hover {
  border-color: var(--accent);
}

button.danger {
  border-color: rgba(255, 93, 122, 0.65);
  background: rgba(255, 93, 122, 0.15);
}

.mini {
  padding: 0.33rem 0.45rem;
}

.form-grid {
  display: grid;
  gap: 0.8rem;
}

.form-grid.compact {
  max-width: 380px;
}

label {
  display: grid;
  gap: 0.33rem;
  color: var(--muted);
}

input {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(5, 22, 38, 0.9);
  color: var(--text);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
}

textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(5, 22, 38, 0.9);
  color: var(--text);
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
  font: inherit;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.checkbox-row input {
  width: auto;
}

.button-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.event-row {
  display: grid;
  grid-template-columns: 2fr 2fr 1fr 1fr;
  gap: 0.45rem;
}

.event-row.down {
  border-color: rgba(255, 93, 122, 0.65);
}

.auth-panel {
  max-width: 440px;
  margin: 3rem auto;
}

@media (max-width: 760px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  nav a {
    margin: 0 0.5rem 0.3rem 0;
    display: inline-block;
  }

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

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.12);
    opacity: 0.75;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes blinkEdge {
  0% {
    box-shadow: 0 0 0 rgba(0, 229, 255, 0.1);
  }
  50% {
    box-shadow: 0 0 24px rgba(0, 229, 255, 0.35);
  }
  100% {
    box-shadow: 0 0 0 rgba(0, 229, 255, 0.1);
  }
}
