/* Header-specific enhancements for the reusable topbar user badge. */

.user-pill .user-avatar-circle{
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  border-radius: 999px;
  object-fit: cover;
  object-position: center;
  display: block;
  background: #e2e8f0;
  border: 1px solid rgba(148,163,184,.22);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.28);
}

.user-pill .user-avatar-fallback{
  display: grid;
  place-items: center;
}

.litcrm-global-notification-toggle.has-unread{
  box-shadow: 0 0 0 1px rgba(249,115,22,.18), 0 12px 24px rgba(249,115,22,.12);
  transform-origin:50% 10%;
  animation: litcrm-notification-pulse 2.2s ease-in-out infinite;
}

@keyframes litcrm-notification-pulse{
  0%, 100% { transform:rotate(0deg); box-shadow:0 0 0 1px rgba(249,115,22,.18), 0 12px 24px rgba(249,115,22,.12); }
  12% { transform:rotate(-5deg); }
  24% { transform:rotate(4deg); box-shadow:0 0 0 4px rgba(249,115,22,.14), 0 16px 30px rgba(249,115,22,.16); }
  36% { transform:rotate(-2deg); }
  48% { transform:rotate(0deg); }
}

@media (prefers-reduced-motion: reduce){
  .litcrm-global-notification-toggle.has-unread{
    animation:none;
  }
}

.litcrm-global-notification-panel{
  width:min(430px, calc(100vw - 24px));
  display:flex;
  flex-direction:column;
  gap:0;
}

.litcrm-global-notification-panel .litcrm-training-panel-head{
  position:sticky;
  top:0;
  z-index:2;
  padding-bottom:14px;
  margin-bottom:0;
  background:linear-gradient(180deg, #ffffff 0%, rgba(255,255,255,.96) 100%);
}

.litcrm-global-notification-panel .litcrm-training-panel-kicker{
  color:#2563eb;
}

.litcrm-global-notification-summary{
  grid-template-columns:repeat(4, minmax(0,1fr));
  gap:10px;
}

.litcrm-global-summary-pill{
  position:relative;
  overflow:hidden;
}

.litcrm-global-summary-pill::before{
  content:'';
  position:absolute;
  inset:0 auto 0 0;
  width:4px;
  background:rgba(148,163,184,.42);
}

.litcrm-global-summary-pill.tone-today::before{
  background:rgba(249,115,22,.96);
}

.litcrm-global-summary-pill.tone-upcoming::before{
  background:rgba(100,116,139,.9);
}

.litcrm-global-summary-pill.tone-overdue::before{
  background:rgba(220,38,38,.95);
}

.litcrm-global-summary-pill.tone-general::before{
  background:rgba(37,99,235,.92);
}

.litcrm-global-notification-list{
  display:flex;
  flex-direction:column;
  gap:16px;
}

.litcrm-global-notice-group{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.litcrm-global-notice-group-title{
  font-size:.74rem;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:#475569;
}

.litcrm-global-notice-group-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.litcrm-global-notice{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:12px;
  align-items:center;
  border:1px solid rgba(148,163,184,.18);
  border-radius:16px;
  background:#fff;
  padding:12px 13px;
  box-shadow:0 10px 22px rgba(15,23,42,.05);
}

.litcrm-global-notice.is-unread{
  border-color:rgba(37,99,235,.18);
  background:linear-gradient(180deg, rgba(248,250,252,.98), rgba(255,255,255,1));
}

.litcrm-global-notice.tone-overdue.is-unread{
  border-color:rgba(220,38,38,.24);
  background:rgba(254,242,242,.96);
}

.litcrm-global-notice.tone-today.is-unread{
  border-color:rgba(249,115,22,.24);
  background:rgba(255,247,237,.96);
}

.litcrm-global-notice-main{
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  gap:12px;
  align-items:flex-start;
  text-decoration:none;
  color:inherit;
  min-width:0;
}

.litcrm-global-notice-icon{
  width:34px;
  height:34px;
  min-width:34px;
  border-radius:999px;
  display:grid;
  place-items:center;
  background:rgba(241,245,249,.9);
  font-size:15px;
}

.litcrm-global-notice.tone-overdue .litcrm-global-notice-icon{
  background:rgba(254,226,226,.94);
}

.litcrm-global-notice.tone-today .litcrm-global-notice-icon{
  background:rgba(255,237,213,.98);
}

.litcrm-global-notice.tone-general .litcrm-global-notice-icon{
  background:rgba(219,234,254,.96);
}

.litcrm-global-notice-copy{
  min-width:0;
}

.litcrm-global-notice-title{
  color:#0f172a;
  font-weight:800;
  line-height:1.25;
}

.litcrm-global-notice-message{
  margin-top:4px;
  color:#334155;
  font-size:.92rem;
  line-height:1.45;
}

.litcrm-global-notice-meta{
  margin-top:8px;
  color:#64748b;
  font-size:.76rem;
}

.litcrm-global-notice-mark{
  align-self:flex-start;
  border:1px solid rgba(148,163,184,.22);
  background:rgba(248,250,252,.9);
  color:#334155;
  border-radius:999px;
  padding:7px 11px;
  font-size:.75rem;
  font-weight:700;
  cursor:pointer;
}

.litcrm-global-notice-mark:hover:not(:disabled){
  border-color:rgba(37,99,235,.24);
  color:#1d4ed8;
}

.litcrm-global-notice-mark:disabled{
  opacity:.6;
  cursor:not-allowed;
}

.litcrm-global-notice-load-more{
  width:100%;
  border:1px solid rgba(30,64,175,.16);
  background:#fff;
  color:#1d4ed8;
  border-radius:10px;
  padding:10px 12px;
  font-weight:700;
  cursor:pointer;
}

.litcrm-global-notice-load-more:hover{
  border-color:rgba(30,64,175,.28);
  background:#eff6ff;
}

.litcrm-global-notification-panel .litcrm-training-panel-actions{
  position:sticky;
  bottom:0;
  z-index:2;
  padding-top:14px;
  background:linear-gradient(180deg, rgba(255,255,255,.82) 0%, #ffffff 36%);
}

.litcrm-global-notification-viewall,
.litcrm-global-notification-markall{
  min-width:120px;
  justify-content:center;
}

@media (max-width: 720px){
  .litcrm-global-notification-summary{
    grid-template-columns:repeat(2, minmax(0,1fr));
  }

  .litcrm-global-notice{
    grid-template-columns:1fr;
  }

  .litcrm-global-notice-mark{
    width:100%;
  }
}

/* ============================================================================
   [2026-08-30] The notification bell, and the panel it opens.

   The bell was static: the number changed and nothing else happened, so people
   only noticed a notification if they happened to be looking at that corner.
   It now swings like a handbell when the unread count rises.

   Motion is a courtesy, not information — anyone who has asked their system to
   reduce motion still gets the count and the chime, just not the swing.
   ========================================================================== */

@keyframes litcrm-bell-ring {
  0%   { transform: rotate(0deg); }
  8%   { transform: rotate(17deg); }
  20%  { transform: rotate(-14deg); }
  32%  { transform: rotate(11deg); }
  44%  { transform: rotate(-8deg); }
  56%  { transform: rotate(6deg); }
  68%  { transform: rotate(-4deg); }
  80%  { transform: rotate(2deg); }
  90%  { transform: rotate(-1deg); }
  100% { transform: rotate(0deg); }
}

.litcrm-notification-btn.is-ringing {
  /* A bell pivots where it hangs, not through its middle. */
  transform-origin: 50% 15%;
  animation: litcrm-bell-ring .95s cubic-bezier(.36, .07, .19, .97) both;
}

@media (prefers-reduced-motion: reduce) {
  .litcrm-notification-btn.is-ringing { animation: none; }
}

/* --- panel header -------------------------------------------------------- */

.litcrm-training-panel-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.litcrm-notif-sound {
  background: none;
  border: 0;
  padding: 4px 6px;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
  opacity: .65;
  transition: opacity .12s ease, background-color .12s ease;
}

.litcrm-notif-sound:hover { opacity: 1; background: rgba(100, 116, 139, .14); }
.litcrm-notif-sound[aria-pressed="false"] { opacity: .4; }

/* --- the one true line that replaced four dead counters ------------------ */

.litcrm-notif-status {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  padding: 2px 0 10px;
}

.litcrm-notif-status.has-unread { color: #1d4ed8; }

/* ============================================================================
   [2026-08-30] Administration, trimmed for the HR Manager role.

   Whole sections she should not see — Company Owner, Dashboard, Customer Service
   — are not rendered at all; look for $litcrmNavHrManagerOnly in header.php.
   This file only trims INSIDE Administration, where the items are numerous and
   individually guarded, and where hiding is the proportionate answer.

   BE CLEAR ABOUT WHAT THIS IS: presentational. The markup is still in the page,
   so this is tidiness, not access control. The pages themselves carry their own
   permission checks, and that is what actually stops her opening them.
   ========================================================================== */

.sidebar[data-nav-role="hr-manager"] .nav-group[data-nav-group="administration"] .nav-collapsible,
.sidebar[data-nav-role="hr-manager"] .nav-group[data-nav-group="administration"] > .nav-group-body > a {
  display: none;
}

/* My Staff is the one Administration item she keeps. */
.sidebar[data-nav-role="hr-manager"] .nav-group[data-nav-group="administration"] .nav-collapsible:has(a[data-page="mystaff.php"]) {
  display: block;
}

/* User Permissions lives inside My Staff and grants the ability to change what
   everyone else can do. Not part of "administration for my staff". */
.sidebar[data-nav-role="hr-manager"] a[data-page="admin/user_permissions.php"] {
  display: none;
}
