:root {
  --bg: #05070a;
  --panel: #0d1117;
  --panel2: #151b23;
  --text: #f2f6ff;
  --muted: #93a4b8;
  --line: #253044;
  --red: #ff3b30;
  --amber: #ffcc00;
  --green: #34c759;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #111827, var(--bg));
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

.topbar {
  min-height: 88px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 7, 10, .92);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
}

h1, h2, h3, p { margin: 0; }

h1 {
  letter-spacing: 4px;
  font-size: 34px;
}

.topbar p {
  color: var(--muted);
  margin-top: 6px;
}

.header-left { text-align: left; }

.header-logo { text-align: center; }

.header-logo img {
  max-height: 72px;
  width: auto;
  filter:
    drop-shadow(0 0 8px rgba(47, 129, 247, .75))
    drop-shadow(0 0 22px rgba(47, 129, 247, .35));
  animation: logoGlow 2.8s ease-in-out infinite;
}

@keyframes logoGlow {
  0%, 100% {
    filter:
      drop-shadow(0 0 7px rgba(47, 129, 247, .55))
      drop-shadow(0 0 18px rgba(47, 129, 247, .25));
  }

  50% {
    filter:
      drop-shadow(0 0 12px rgba(47, 129, 247, .95))
      drop-shadow(0 0 34px rgba(47, 129, 247, .55));
  }
}

.clock { text-align: right; }

.clock span {
  font-size: 34px;
  font-weight: 800;
}

.clock small {
  display: block;
  color: var(--muted);
}

.layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 18px;
  padding: 18px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.section-title h2 {
  letter-spacing: 3px;
}

.section-title span {
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 7px 12px;
  border-radius: 999px;
}

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

.alert-card {
  display: grid;
  grid-template-columns: 128px 1fr;
  min-height: 118px;
  background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border: 1px solid var(--line);
  border-left: 8px solid var(--cat);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(0,0,0,.24);
}

.alert-left {
  padding: 10px 8px;
  background: rgba(255,255,255,.04);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  text-align: center;
}

.cat-icon {
  font-size: 30px;
  line-height: 1;
}

.cat-name {
  color: var(--muted);
  font-weight: 800;
  letter-spacing: 1px;
  font-size: 15px;
  line-height: 1.18;
}

.service-logo {
  max-width: 74px;
  max-height: 58px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(255,255,255,.3));
}

.alert-body {
  padding: 13px 16px;
}

.alert-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.alert-head h3 {
  font-size: 24px;
  text-transform: uppercase;
  line-height: 1.12;
}

.priority {
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--cat);
  color: #000;
  font-weight: 900;
  min-width: 54px;
  text-align: center;
}

.location {
  margin: 7px 0 4px;
  color: #d7e2f1;
  font-size: 17px;
  font-weight: 700;
}

.details {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.meta {
  margin-top: 8px;
  display: flex;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
}

.critical { animation: pulse 1s infinite; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 rgba(255, 59, 48, 0); }
  50% { box-shadow: 0 0 35px rgba(255, 59, 48, .45); }
}

.side-panel {
  display: grid;
  gap: 12px;
  align-content: start;
}

.notice, .card {
  background: rgba(13,17,23,.92);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
}

.notice strong {
  display: block;
  margin-bottom: 8px;
}

.notice span, .notice a, .hint { color: var(--muted); }

.notice.emergency { border-color: var(--red); }

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

.admin-wrap {
  padding: 20px;
  max-width: 1450px;
  margin: 0 auto;
}

.grid {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 18px;
  align-items: start;
}

.card h2 { margin-bottom: 16px; }

label {
  display: block;
  color: var(--muted);
  margin: 14px 0 6px;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #05070a;
  color: var(--text);
  padding: 12px;
  border-radius: 10px;
  font-size: 15px;
}

.btn {
  margin-top: 16px;
  border: 0;
  background: #2f81f7;
  color: white;
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
}

.btn.danger { background: var(--red); color: #fff; }

.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
}

.hidden { display: none !important; }

.msg {
  color: var(--muted);
  margin-top: 12px;
}

.admin-alert, .category-row {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.admin-alert span { color: var(--muted); }

.mini {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 8px;
  padding: 7px 10px;
  cursor: pointer;
}

.category-row span {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-block;
}

.owner-only {
  grid-column: span 1;
}

@media (max-width: 900px) {
  .layout, .grid {
    grid-template-columns: 1fr;
  }

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

  h1 { font-size: 26px; }

  .topbar {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .header-left,
  .clock {
    text-align: center;
  }
}

.notice a {
  display: inline-block;
  color: #7db7ff;
  text-decoration: none;
  font-weight: 700;
  margin-top: 8px;
}

.notice a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.cat-name {
  font-size: 13px;
  line-height: 1.05;
  max-width: 108px;
  margin: 0 auto;
  overflow-wrap: break-word;
  word-break: normal;
  white-space: normal;
}

.alert-left {
  overflow: hidden;
}

.service-logo {
  max-width: 62px;
  max-height: 48px;
}