/* ═══════════════════════════════════════════════════════════════
   APP HEADER — Dark Cinematic + Emerald accent
═══════════════════════════════════════════════════════════════ */
#screen-app { display: flex; flex-direction: column; min-height: 100dvh; }

.app-header {
  position: -webkit-sticky; position: sticky; top: 0; z-index: 100;
  background: rgba(30, 34, 53, 0.8);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  border-bottom: 1px solid rgba(245, 240, 232, 0.04);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5), inset 0 -1px 0 rgba(198, 164, 78, 0.06);
}
.header-inner {
  display: flex; align-items: center; gap: 10px;
  max-width: 1280px; margin: 0 auto;
  padding: 0 16px;
  height: 74px;
}
.btn-back {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  color: var(--cream);
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--trans), color var(--trans);
}
.btn-back:hover { background: rgba(198, 164, 78, 0.08); color: var(--gold, #C6A44E); }

.header-brand { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.header-logo {
  flex-shrink: 0;
  background: linear-gradient(135deg, #C6A44E, #D4B85C);
  color: #1E2235;
  font-family: var(--font-heading);
  font-size: 14px; font-weight: 700; letter-spacing: -.5px;
  padding: 5px 12px;
  border-radius: var(--r-sm);
  box-shadow: 0 2px 12px rgba(198, 164, 78, 0.2);
}
.header-logo-img {
  height: 58px;
  width: auto;
  flex-shrink: 0;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(198, 164, 78, 0.15));
  transition: opacity var(--trans), filter var(--trans);
}
.header-logo-img:hover {
  filter: drop-shadow(0 2px 12px rgba(198, 164, 78, 0.3));
}
.header-right {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.header-email {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(198, 164, 78, 0.1);
  color: var(--gold, #C6A44E);
  font-size: 11px; font-weight: 700; letter-spacing: .5px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; cursor: pointer;
  border: 1.5px solid rgba(198, 164, 78, 0.25);
  transition: all 0.25s ease;
}
.header-email:hover {
  background: rgba(198, 164, 78, 0.18);
  border-color: rgba(198, 164, 78, 0.4);
  transform: scale(1.05);
}
.btn-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  color: var(--cream-dim);
  font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--trans), color var(--trans);
}
.btn-icon:hover { background: rgba(198, 164, 78, 0.08); color: var(--gold, #C6A44E); }
.btn-logout { color: var(--cream-muted); }
.btn-logout:hover { color: #EF4444; background: rgba(239, 68, 68, 0.08); }

.btn-courses {
  display: flex; align-items: center; gap: 6px;
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.2);
  color: #34D399;
  border-radius: var(--r-full);
  padding: 7px 18px;
  font-family: var(--font-heading);
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-courses:hover {
  background: rgba(52, 211, 153, 0.15);
  border-color: rgba(52, 211, 153, 0.35);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(52, 211, 153, 0.15);
}
.btn-courses.active {
  background: var(--gradient-primary, linear-gradient(135deg, #34D399, #6EE7B7));
  border-color: #34D399; color: #1E2235;
  box-shadow: 0 4px 16px rgba(52, 211, 153, 0.25);
}
.btn-courses span { display: none; }
@media (min-width: 420px) { .btn-courses span { display: inline; } }

@media (max-width: 559px) {
  .header-inner {
    gap: 6px;
    padding: 0 10px;
    height: 66px;
  }
  .header-brand {
    flex: 1 1 auto;
    overflow: hidden;
  }
  .header-logo-img {
    height: 40px;
  }
  .header-right {
    gap: 4px;
  }
  .btn-courses {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
  }
  .header-email {
    width: 32px;
    height: 32px;
  }
  .btn-icon, .btn-trainer-dash, .btn-admin-dash {
    width: 34px;
    height: 34px;
  }
}

.btn-trainer-dash, .btn-admin-dash {
  width: 36px; height: 36px;
  border-radius: 50%;
  color: var(--cream-dim);
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--trans), color var(--trans);
}
.btn-trainer-dash:hover, .btn-admin-dash:hover { background: rgba(198, 164, 78, 0.08); color: var(--gold, #C6A44E); }

/* ── Header avatar ── */
.header-avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  cursor: pointer;
}
#header-email { cursor: pointer; }

/* ── Announcements bell ── */
.announcements-wrap { position: relative; display: inline-flex; align-items: center; }
.btn-bell {
  position: relative;
  background: none;
  border: none;
  color: inherit;
  font-size: 18px;
  cursor: pointer;
  padding: 6px 10px;
}
.bell-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #e74c3c;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

/* ── Announcements panel (dark theme, fixed colors) ── */
.announcements-panel {
  position: absolute;
  top: 100%;
  right: 0;
  width: 380px;
  max-height: 500px;
  background: #1e2235;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  z-index: 1000;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.ann-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.ann-panel-title { font-weight: 600; font-size: 16px; color: #f5f5f5; }
.ann-mark-all {
  background: none;
  border: none;
  color: #26a69a;
  font-size: 13px;
  cursor: pointer;
}
.ann-panel-list {
  overflow-y: auto;
  max-height: 440px;
  padding: 8px 0;
}
.ann-empty {
  text-align: center;
  padding: 40px 16px;
  color: #8890a4;
  font-size: 14px;
}
.ann-item {
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s;
  border-left: 3px solid transparent;
}
.ann-item:hover { background: rgba(255,255,255,0.05); }
.ann-unread { background: rgba(38,166,154,0.08); }
.ann-read { background: transparent; }
.ann-urgent { border-left-color: #e74c3c; }
.ann-info { border-left-color: #95a5a6; }
.ann-item:not(.ann-urgent):not(.ann-info) { border-left-color: #26a69a; }
.ann-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.ann-author-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}
.ann-author-initial {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #26a69a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}
.ann-author { font-weight: 500; font-size: 13px; color: #ddd; }
.ann-time { font-size: 12px; color: #8890a4; margin-left: auto; }
.ann-pin { color: #26a69a; font-size: 12px; }
.ann-item-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; color: #f5f5f5; }
.ann-item-body {
  font-size: 13px;
  color: #a0a8bc;
  line-height: 1.4;
  overflow: hidden;
  max-height: 40px;
}
.ann-item-body.ann-expanded { max-height: none; }
@media (max-width: 480px) {
  .announcements-panel {
    position: fixed;
    top: 56px;
    left: 10px;
    right: 10px;
    width: auto;
  }
}

/* ── Online counter ───────────────────────────────────────────────────── */
.online-counter {
  background: #4caf50;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 4px;
  display: inline-block;
}
.online-counter.hidden { display: none; }
