/* ============================================================
   Circloud app header — matches NEST / spidermind exactly.

   STRUCTURE (use this exact markup on every page):
     <header class="ch">
       <a class="ch-brand-link" href="/">
         <div class="cr-brand" data-size="sm">
           <img class="cr-brand-logo" src="/assets/logo-256.webp" alt="Circloud">
           <div class="cr-brand-box">
             <span class="cr-brand-reg">&reg;</span>
             <div class="cr-brand-name">Circloud</div>
             <div class="cr-brand-sub"><span>E</span><span>V</span>...</div>
           </div>
         </div>
       </a>
       <nav class="ch-nav"> ... </nav>
     </header>

   The `.cr-brand` styles live in assets/brand.css — the same file the
   other Circloud projects use, so the brand block (logo + Circloud +
   EVENTSARO) is visually identical across the suite.

   This file owns only the outer <header> shell (height, padding,
   background) and the right-hand nav pills. Values are px, not rem,
   so they match the Nest header regardless of the page's root size.
   ============================================================ */

.ch,
header.ch {
  box-sizing: border-box;
  height: 52px;
  padding: 1px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(12, 15, 34, 0.86);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 1000;
  overflow: visible;
  font-family: var(--ui-font-family);
  color: #fff;
}

.ch-brand-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  flex: 0 0 auto;
  height: 100%;
}

/* Sublabel rendered to the right of the brand block, e.g. "| Admin" */
.ch-tag-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.10);
  margin: 0 8px;
  flex: 0 0 auto;
}
.ch-page-tag {
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  color: rgba(167, 176, 209, 0.85);
  white-space: nowrap;
  flex: 0 0 auto;
}
.ch-page-tag-ver {
  margin-left: 4px;
  font-size: 11px;
  font-weight: 400;
  color: rgba(167, 176, 209, 0.5);
  letter-spacing: 0;
}

.ch-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1 1 auto;
  justify-content: flex-end;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.ch-nav::-webkit-scrollbar { display: none; }

.ch-link {
  color: var(--text-secondary, #a7b0d1);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
  background: transparent;
  border: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}
.ch-link[hidden] { display: none !important; }

.ch-link:hover {
  color: var(--text, #ffffff);
  background: rgba(255, 255, 255, 0.1);
}

.ch-link.is-active,
.ch-link[aria-current="page"],
.ch-link.active {
  color: var(--text, #ffffff);
  background: rgba(139, 156, 255, 0.2);
  box-shadow: none;
}

.ch-link svg,
.ch-link .ch-icon {
  width: 13px;
  height: 13px;
  fill: currentColor;
  flex: 0 0 auto;
}

@media (max-width: 540px) {
  .ch { padding: 0 8px; gap: 6px; }
  .ch-link span { display: none; }
  .ch-link { padding: 8px; min-width: 29px; min-height: 29px; }
  .ch-page-tag { display: none; }
  .ch-tag-divider { display: none; }
}
