.admin-launch[hidden] {
  display: none !important;
}
.admin-launch {
  color: #f8dda0 !important;
  border: 1px solid #ad955c !important;
  background: #183b40 !important;
  padding: 0.5rem 0.8rem !important;
  font-size: 0.85rem !important;
  min-height: 40px;
}
#adminPanel {
  width: min(1080px, 96vw);
  max-width: 96vw;
  height: min(860px, 94dvh);
  max-height: 94dvh;
  padding: 0;
  border: 1px solid #bca477;
  border-radius: 20px;
  color: #eee9db;
  background: #101f27 url("/assets/interface/admin-observatory.webp") center
    top/cover;
  box-shadow: 0 20px 100px #000a;
  overflow: hidden;
}
#adminPanel[open] {
  display: flex;
  flex-direction: column;
}
#adminPanel::backdrop {
  background: #020c13cc;
  backdrop-filter: blur(5px);
}
.admin-heading {
  position: relative;
  padding: 24px 95px 22px 26px;
  background: linear-gradient(90deg, #081821e8, #08182166);
}
.admin-heading h2 {
  margin: 0.2rem 0;
  color: #ffe1a3;
  font:
    1.8rem Georgia,
    serif;
}
.admin-heading p {
  margin: 0.4rem 0;
  font-size: 0.9rem;
}
.admin-eyebrow {
  font-size: 0.65rem !important;
  letter-spacing: 0.2em;
  color: #90ced5;
}
.admin-close {
  position: absolute;
  right: 16px;
  top: 18px;
}
.admin-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 16px;
  overflow: auto;
  background: #08171ef0;
  flex-shrink: 0;
}
#adminPanel button {
  min-height: 44px;
  color: #ead9b4;
  background: linear-gradient(#25434a, #152b34);
  border: 1px solid #7c795f;
  border-radius: 9px;
  padding: 9px 12px;
  cursor: pointer;
  font: inherit;
}
#adminPanel button:hover {
  background: #335963;
  border-color: #efd89e;
}
#adminPanel button:focus-visible,
#adminPanel input:focus-visible,
#adminPanel select:focus-visible {
  outline: 3px solid #8be2ec;
  outline-offset: 2px;
}
.admin-tabs button[aria-current="page"] {
  background: linear-gradient(#b49860, #796135);
  color: #fff8e9;
  border-color: #f6dda3;
}
.admin-tabs button[hidden] {
  display: none;
}
.admin-filters {
  display: flex;
  gap: 16px;
  padding: 12px 18px;
  background: #0b1c25f5;
  flex-shrink: 0;
}
#adminPanel label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.8rem;
  color: #c4d4d6;
}
.admin-filters label:first-child {
  flex: 1;
}
#adminPanel input,
#adminPanel select {
  background: #091920;
  color: #eee9db;
  border: 1px solid #57747b;
  border-radius: 8px;
  padding: 10px;
  min-height: 44px;
  width: 100%;
  box-sizing: border-box;
  font: inherit;
}
.admin-content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 12px;
  padding: 18px;
  overflow: auto;
  min-height: 0;
  align-content: start;
  background: #091920e8;
  overscroll-behavior: contain;
}
.admin-card {
  padding: 16px;
  border: 1px solid #57605c;
  border-radius: 12px;
  background: linear-gradient(145deg, #263a42e8, #101f29f0);
  box-shadow: inset 0 1px #c5ae6b22;
  min-width: 0;
}
.admin-card h3 {
  color: #f5dca5;
  font:
    1.12rem Georgia,
    serif;
  margin: 0.2rem 0 0.6rem;
  overflow-wrap: anywhere;
}
.admin-card p {
  color: #bbcccf;
  font-size: 0.83rem;
  line-height: 1.5;
  margin: 0.3rem 0 12px;
}
.admin-card small {
  display: block;
  margin: 6px 0;
}
.admin-card .admin-action {
  width: 100%;
  margin-top: 8px;
}
.admin-card canvas:not(.admin-map-thumb) {
  float: right;
  width: 64px;
  height: 64px;
  image-rendering: auto;
}
.admin-map-thumb {
  width: 100%;
  height: auto;
  border: 1px solid #637b75;
  border-radius: 7px;
  background: #12242b;
  margin-bottom: 12px;
}
.admin-region,
.admin-note,
.admin-history {
  grid-column: 1/-1;
}
.admin-region {
  color: #e5c581;
  margin: 12px 0 0;
  font:
    1.2rem Georgia,
    serif;
}
.admin-note {
  font-size: 0.85rem;
  color: #c1d3d6;
}
.admin-history {
  padding-left: 25px;
  font-size: 0.83rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.admin-history li {
  padding: 9px;
  border-bottom: 1px solid #50616a;
}
.admin-status {
  margin: 0;
  padding: 12px 20px;
  background: #0c202af5;
  border-top: 1px solid #6c715d;
  min-height: 22px;
  font-size: 0.85rem;
  color: #aee0cf;
  flex-shrink: 0;
}
.admin-status[data-error="true"] {
  color: #ffb4a3;
}
@media (max-width: 600px) {
  #adminPanel {
    width: 100vw;
    max-width: 100vw;
    height: 96dvh;
    max-height: 96dvh;
    border-radius: 16px 16px 0 0;
    margin: auto 0 0;
  }
  .admin-heading {
    padding: 16px 82px 12px 16px;
  }
  .admin-heading h2 {
    font-size: 1.35rem;
  }
  .admin-heading p:not(.admin-eyebrow) {
    display: none;
  }
  .admin-tabs {
    padding: 8px;
  }
  .admin-tabs button {
    white-space: nowrap;
    font-size: 0.84rem;
  }
  .admin-filters {
    padding: 10px;
    gap: 8px;
  }
  .admin-filters label {
    min-width: 0;
    flex: 1;
  }
  .admin-content {
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 8px;
    padding: 10px;
  }
  .admin-card {
    padding: 10px;
  }
  .admin-card h3 {
    font-size: 1rem;
  }
  .admin-card button {
    font-size: 0.8rem;
  }
  .admin-card canvas:not(.admin-map-thumb) {
    width: 45px;
    height: 45px;
  }
  .admin-launch {
    padding: 6px !important;
  }
  .admin-status {
    padding: 10px;
    font-size: 0.8rem;
  }
}
@media (prefers-reduced-motion: no-preference) {
  #adminPanel[open] {
    animation: admin-appear 0.2s ease-out;
  }
  @keyframes admin-appear {
    from {
      opacity: 0;
      transform: translateY(8px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}

#adminPanel .admin-heading {
  display: block;
  min-height: 135px;
  box-sizing: border-box;
  background:
    linear-gradient(90deg, #081821e8 10%, #081821aa 58%, #08182122),
    url("/assets/interface/admin-observatory.webp") center 28% / cover;
}
#adminPanel .admin-heading h2 {
  font-size: 2rem;
  max-width: 600px;
}
#adminPanel .admin-tabs {
  background: #091920df;
}
#adminPanel .admin-content {
  background: #091920d9;
}
#adminPanel .admin-filters {
  background: #0b1c25df;
}
@media (max-width: 600px) {
  #adminPanel .admin-heading {
    min-height: 120px;
    padding-right: 86px;
  }
  #adminPanel .admin-heading h2 {
    font-size: 1.4rem;
  }
}

#adminPanel .admin-heading h2 {
  white-space: normal;
  overflow-wrap: break-word;
  line-height: 1.15;
}
#adminPanel .admin-tabs button[aria-current="page"] {
  background: linear-gradient(#a38a57, #68532f);
  border-color: #e9cd8b;
  color: #fff9e9;
}
#adminPanel .admin-content[data-section="tools"],
#adminPanel .admin-content[data-section="access"],
#adminPanel .admin-content[data-section="history"] {
  grid-template-columns: 1fr;
}
#adminPanel .admin-content[data-section="tools"] .admin-card {
  max-width: 650px;
}
#adminPanel .admin-content {
  flex: 1;
}
@media (max-width: 600px) {
  #adminPanel .admin-heading h2 {
    max-width: 260px;
    padding-right: 30px;
    font-size: 1.3rem;
  }
}
