/* Raw Community — admin overrides */
.ad-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--header-height);
  padding: 0 max(24px, calc((100vw - var(--page-max)) / 2));
  gap: 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.ad-topbar .ad-title { gap: 11px; }
.ad-logo { width: 40px; height: 40px; display: block; }
.ad-title-main {
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.ad-title-sub {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.ad-container { max-width: var(--page-max); margin: 0 auto; padding: 32px 24px 80px; }
.ad-section { margin-bottom: 36px; }
.ad-section-head {
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.ad-section-head h2 {
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.ad-section-head h2 .material-icons-round { color: var(--brand); }
.ad-section-head p { color: var(--dim); font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.05em; }

.ad-card,
.ad-stat {
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.ad-card::before { display: none; }
.ad-card-body { padding: 18px; }
.ad-card h3 {
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ad-btn {
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: none;
}
.ad-btn:hover { border-color: var(--line-strong); background: var(--panel); color: var(--fg); }
.ad-btn.is-ghost { border-color: transparent; color: var(--dim); }
.ad-btn.is-ghost:hover { border-color: var(--line); background: var(--panel); color: var(--fg); }
.ad-btn.is-primary { border-color: var(--brand); background: var(--brand); color: #fff; box-shadow: none; }
.ad-btn.is-primary:hover { background: color-mix(in srgb, var(--brand) 85%, black); border-color: color-mix(in srgb, var(--brand) 85%, black); }
.ad-btn.is-danger { border-color: rgba(var(--brand-rgb), 0.45); color: var(--brand); }
.ad-btn.is-danger:hover { border-color: var(--brand); background: rgba(var(--brand-rgb), 0.08); }
.ad-btn.is-small { height: 34px; font-size: 9px; }

.ad-stats { gap: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.ad-stat { border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 16px; }
.ad-stat .ad-stat-label {
  margin-bottom: 8px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.12em;
}
.ad-stat .ad-stat-value { color: var(--fg); font-family: var(--font-mono); font-size: 19px; font-weight: 500; }
.ad-stat .ad-stat-sub { color: var(--dim); font-family: var(--font-mono); font-size: 9px; }
.ad-meter { height: 5px; border-radius: 0; background: var(--line); }
.ad-meter > span { border-radius: 0; background: var(--brand); }

.ad-chip {
  height: 27px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ad-chip b { color: var(--fg); }
.ad-chip.is-accent { border-color: rgba(var(--brand-rgb), 0.4); background: rgba(var(--brand-rgb), 0.06); color: var(--brand); }
.ad-chip.is-ok { border-color: rgba(78, 250, 156, 0.25); background: transparent; color: var(--ok); }
.ad-chip.is-bad { border-color: rgba(var(--brand-rgb), 0.4); background: transparent; color: var(--brand); }
.ad-chip .dot { border-radius: 999px; }

.ad-table { border: 1px solid var(--line); }
.ad-table th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.ad-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--fg);
  font-size: 12px;
}
.ad-table tr:last-child td { border-bottom: 0; }
.ad-table tr:hover td { background: var(--panel); }

.ad-alert {
  border: 1px solid rgba(var(--brand-rgb), 0.35);
  border-radius: 0;
  background: rgba(var(--brand-rgb), 0.06);
  color: var(--brand);
  font-family: var(--font-mono);
  font-size: 10px;
}

.ad-input,
.ad-select {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--fg);
  font-family: var(--font-sans);
}
.ad-input:focus,
.ad-select:focus { border-color: var(--line-strong); box-shadow: 0 0 0 1px var(--line-strong); }

.ad-loading,
.ad-empty,
.ad-maint,
.ad-muted { color: var(--dim); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.04em; }

.ad-kv,
.ad-log {
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

@media (max-width: 768px) {
  .ad-topbar { padding-inline: 16px; }
  .ad-logo { width: 34px; height: 34px; }
  .ad-title-main { font-size: 11px; }
  .ad-title-sub { display: none; }
  .ad-container { padding: 22px 16px 80px; }
  .ad-section-head { flex-wrap: wrap; }
  .ad-btn { height: 36px; }
}

/* Theme selector in the admin top bar: exact rawcommunity.es sizing */
.ad-topbar .theme-menu { position: relative; display: inline-flex; align-items: center; }
.ad-topbar .theme-menu #themeToggleButton {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--dim);
  transition: color .15s, border-color .15s, background .15s;
}
.ad-topbar .theme-menu #themeToggleButton:hover {
  border-color: var(--line-strong);
  background: var(--panel);
  color: var(--fg);
}
.ad-topbar .theme-menu #themeToggleButton .theme-icon { display: inline-flex; width: 16px; height: 16px; align-items: center; justify-content: center; }
.ad-topbar .theme-menu #themeToggleButton .theme-icon svg { display: block; width: 16px; height: 16px; }
.ad-topbar .theme-menu #themeToggleButton .theme-chevron { display: none; width: 14px; height: 14px; }
.ad-topbar .theme-menu #themeToggleButton #themeText {
  display: none !important;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
}
@media (min-width: 640px) {
  .ad-topbar .theme-menu #themeToggleButton .theme-chevron { display: block; }
}
@media (min-width: 768px) {
  .ad-topbar .theme-menu #themeToggleButton { width: auto; padding: 0 12px; }
}
@media (min-width: 1280px) {
  .ad-topbar .theme-menu #themeToggleButton #themeText { display: inline !important; }
}
.ad-topbar .theme-menu .theme-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 120;
  display: none;
  min-width: 160px;
  padding: 4px;
  border: 1px solid var(--line);
  background: var(--bg);
  box-shadow: 0 20px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.1);
}
.ad-topbar .theme-menu .theme-dropdown.show { display: block; }
.ad-topbar .theme-menu .theme-dropdown .menu-item {
  display: flex;
  min-height: 32px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
}
.ad-topbar .theme-menu .theme-dropdown .menu-item:hover,
.ad-topbar .theme-menu .theme-dropdown .menu-item:focus-visible {
  background: var(--panel);
  color: var(--fg);
  outline: none;
}
.ad-topbar .theme-menu .theme-dropdown .theme-option-label { display: inline-flex; align-items: center; gap: 10px; }
.ad-topbar .theme-menu .theme-dropdown .theme-icon { display: inline-flex; width: 16px; height: 16px; align-items: center; justify-content: center; }
.ad-topbar .theme-menu .theme-dropdown .theme-icon svg { display: block; width: 16px; height: 16px; }
.ad-topbar .theme-menu .theme-dropdown .theme-check { display: none; width: 14px; height: 14px; color: var(--brand); }
.ad-topbar .theme-menu .theme-dropdown .menu-item.active .theme-check { display: block; }

/* Portaled theme dropdown: target by id so it works outside .theme-menu */
#themeDropdown {
  box-sizing: border-box;
  width: auto;
  min-width: 160px !important;
  padding: 4px !important;
  border: 1px solid var(--line) !important;
  border-radius: 0 !important;
  background: var(--bg) !important;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.1) !important;
  margin: 0 !important;
}
#themeDropdown .menu-item {
  display: flex;
  box-sizing: border-box;
  height: auto;
  min-height: 0;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 12px !important;
  margin: 0 !important;
  border: 0;
  border-radius: 0 !important;
  background: transparent;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 10px !important;
  font-weight: 400 !important;
  letter-spacing: 0.14em !important;
  line-height: 1 !important;
  text-transform: uppercase;
  text-decoration: none;
}
#themeDropdown .menu-item:hover,
#themeDropdown .menu-item:focus-visible {
  background: var(--panel);
  color: var(--fg);
  outline: none;
}
#themeDropdown .menu-item.active { background: transparent; color: var(--dim); }
#themeDropdown .menu-item.active:hover { background: var(--panel); color: var(--fg); }
#themeDropdown .theme-option-label { display: inline-flex; align-items: center; gap: 10px; }
#themeDropdown .theme-icon { display: inline-flex; width: 16px; height: 16px; align-items: center; justify-content: center; }
#themeDropdown .theme-icon svg { display: block; width: 16px !important; height: 16px !important; }
#themeDropdown .theme-check { display: none; width: 14px !important; height: 14px !important; flex: 0 0 14px; color: var(--brand); }
#themeDropdown .menu-item.active .theme-check { display: block; }
