/* Shared top bar + menu for every admin page; ALL admin navigation lives in the menu (admin.htm, admin-stats.htm, admin-eggs.htm).
   Markup per page:  <header class="adm-bar"> back button, <h1>, optional page buttons, <div class="adm-menu" id="admMenu" data-current="..."> </header>
   js/admin-nav.js fills in the hamburger button and the dropdown from its one list of pages. */

:root { --adm-btn-h: 48px; }                       /* every button in the bar and the menu shares this height */
@media (max-width: 600px) { :root { --adm-btn-h: 44px; } }

header.adm-bar {
  position: sticky;                                /* stays reachable while you scroll a long list */
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  z-index: 50;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  padding: 8px 10px;
  margin: 0 0 22px;                                /* clear space between the bar and the page below it */
  background: rgba(42, 31, 71, .94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
}
header.adm-bar h1 {
  flex: 1 1 auto;
  min-width: 0;
  order: 0;
  margin: 0;
  font: 700 22px "Fredoka", sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
header.adm-bar h1 span { color: var(--yellow); }
@media (max-width: 600px) { header.adm-bar h1 { font-size: 19px; } }

/* back arrow and hamburger: square buttons */
.adm-icon, .adm-menu-btn {
  flex: none;
  width: var(--adm-btn-h);
  height: var(--adm-btn-h);
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font: 800 22px "Nunito", system-ui, sans-serif;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.adm-icon:hover, .adm-menu-btn:hover { filter: brightness(1.12); }
.adm-icon:focus-visible, .adm-menu-btn:focus-visible, .adm-item:focus-visible { outline: 2px solid var(--magenta); outline-offset: 2px; }
header.adm-bar .btn { height: var(--adm-btn-h); min-height: var(--adm-btn-h); }   /* e.g. "+ New egg" */

/* the three-bar hamburger icon; turns into an X while the menu is open */
.adm-burger, .adm-burger::before, .adm-burger::after {
  display: block; width: 20px; height: 2.5px; border-radius: 2px; background: currentColor; transition: transform .18s, opacity .18s;
}
.adm-burger { position: relative; }
.adm-burger::before, .adm-burger::after { content: ""; position: absolute; left: 0; }
.adm-burger::before { top: -6.5px; }
.adm-burger::after  { top: 6.5px; }
.adm-menu-btn[aria-expanded="true"] .adm-burger { background: transparent; }
.adm-menu-btn[aria-expanded="true"] .adm-burger::before { transform: translateY(6.5px) rotate(45deg); }
.adm-menu-btn[aria-expanded="true"] .adm-burger::after  { transform: translateY(-6.5px) rotate(-45deg); }

/* the dropdown */
.adm-menu { position: relative; flex: none; }
.adm-panel {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  z-index: 60;
  width: min(300px, calc(100vw - 32px));
  padding: 8px;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .55);
}
.adm-panel.open { display: grid; animation: admIn .14s ease-out; }
@keyframes admIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.adm-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--adm-btn-h);                    /* same size for every item, and the same as the buttons above */
  padding: 0 16px;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
  font: 800 16px "Nunito", system-ui, sans-serif;
  text-decoration: none;
}
.adm-item .adm-ico { flex: none; width: 24px; text-align: center; font-size: 19px; line-height: 1; }
.adm-item:hover { filter: brightness(1.12); }
.adm-item[aria-current="page"] { background: var(--yellow); color: #3A2A00; }
.adm-item .adm-new { margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 99px; background: var(--magenta); color: #fff; font-size: 12px; line-height: 22px; text-align: center; }

/* a dot on the hamburger when something inside the menu needs attention (e.g. new feedback) */
.adm-menu-btn { position: relative; }
.adm-menu-btn[data-dot]::after {
  content: ""; position: absolute; top: 7px; right: 7px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--magenta); border: 2px solid var(--surface-2);
}
@media (prefers-reduced-motion: reduce) { .adm-panel.open { animation: none; } .adm-burger, .adm-burger::before, .adm-burger::after { transition: none; } }
