/* Notifications (B-011): the right panel from the bell, its progress card, and the
   #/notifications page with the MISSING ACTIVITY card. Colours only via tokens.css. */

/* ---- Panel: 352px, full height, slides in from the right ---- */
.notif-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: var(--z-popover);
  width: min(var(--notif-panel-w), 100vw); display: flex; flex-direction: column;
  background: var(--bg-app); border-left: 1px solid var(--border); box-shadow: var(--shadow-floating);
  transform: translateX(16px); opacity: 0;
  transition: transform var(--t-med) var(--ease-enter), opacity var(--t-med) var(--ease-enter);
}
.notif-panel.is-open { transform: none; opacity: 1; }
.notif-panel.is-closing { transform: translateX(16px); opacity: 0; transition-timing-function: var(--ease-exit); }
.notif-head {
  display: flex; align-items: center; gap: var(--sp-4); height: var(--topbar-h); flex: none;
  padding: 0 var(--sp-5) 0 var(--sp-6); background: var(--bg-surface); border-bottom: 1px solid var(--border);
}
.notif-title { margin: 0; flex: 1; font-size: var(--fs-lg); line-height: var(--lh-lg); font-weight: var(--fw-semibold); }
.notif-x {
  width: var(--control-h); height: var(--control-h); border: 0; border-radius: var(--r-md);
  background: none; color: var(--text-2); display: grid; place-items: center; cursor: pointer;
}
.notif-x:hover { background: var(--bg-hover); color: var(--text); }
.notif-x:focus-visible { outline: 2px solid var(--border-focus); outline-offset: -2px; }
.notif-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: var(--sp-6); display: flex; flex-direction: column; gap: var(--sp-5); }

/* ---- Cards ---- */
.notif-card {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: var(--sp-6);
}
.notif-card-caption {
  font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--text-2);
  text-transform: uppercase; letter-spacing: 0.2px; margin-bottom: var(--sp-5);
}
.notif-empty { color: var(--text-2); padding: var(--sp-4) 0; }

/* Progress: three rings, then the month numbers */
.progress-sub { font-weight: var(--fw-semibold); margin: var(--sp-2) 0 var(--sp-4); align-self: flex-start; }
.rings { display: flex; justify-content: space-around; margin-bottom: var(--sp-6); }
.ring { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); }
.ring-graphic { position: relative; width: 56px; height: 56px; }
.ring-graphic svg { width: 56px; height: 56px; display: block; }
.ring-track { stroke: var(--ring-track); }
.ring-arc { transition: stroke-dasharray var(--t-slow) var(--ease-enter); }
.ring-num {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: var(--fs-lg); font-weight: var(--fw-semibold);
}
.ring-label { color: var(--text-2); }
.month-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); }
.month-stat { display: flex; flex-direction: column; align-items: center; gap: var(--sp-1); min-width: 0; }
.month-stat-top { display: flex; align-items: baseline; gap: var(--sp-2); }
.month-num { font-size: var(--fs-lg); font-weight: var(--fw-semibold); white-space: nowrap; }
.month-label { font-size: var(--fs-sm); color: var(--text-2); text-align: center; }
.delta { display: inline-flex; align-items: center; gap: var(--sp-1); font-size: var(--fs-xs); white-space: nowrap; }
.delta.is-up { color: var(--delta-up); }
.delta.is-down { color: var(--delta-down); }
.delta-ic { display: inline-grid; width: 8px; height: 8px; }
.delta-ic svg { width: 8px; height: 8px; }

/* Latest items */
.notif-latest { padding: var(--sp-5) 0; }
.notif-latest .notif-card-caption { padding: 0 var(--sp-6); margin-bottom: var(--sp-3); }
.notif-latest .skeleton { padding: 0 var(--sp-6); }
.notif-item {
  display: flex; align-items: flex-start; gap: var(--sp-5); width: 100%;
  padding: var(--sp-4) var(--sp-6); border: 0; background: none; text-align: left; cursor: pointer; color: var(--text);
  transition: background var(--t-fast) var(--ease);
}
.notif-item:hover { background: var(--bg-hover); }
.notif-item:focus-visible { outline: 2px solid var(--border-focus); outline-offset: -2px; }
.notif-item-ic {
  width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--tile-blue-bg); color: var(--tile-blue);
  display: grid; place-items: center;
}
.notif-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-1); }
.notif-item-title { line-height: var(--lh-md); overflow-wrap: anywhere; }
.notif-item.is-unread .notif-item-title { font-weight: var(--fw-semibold); }
.notif-item-body { color: var(--text-2); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.notif-item-time { color: var(--text-muted); font-size: var(--fs-sm); }
.notif-dot { width: 8px; height: 8px; margin-top: 6px; flex: none; border-radius: 50%; background: var(--notif-unread-dot); }

/* "All notifications · N unread >" */
.notif-all {
  display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-5) var(--sp-6);
  color: var(--text); text-decoration: none; font-weight: var(--fw-semibold);
}
.notif-all:hover { background: var(--bg-hover); text-decoration: none; }
.notif-all-label { flex: 1; }
.notif-all-count { color: var(--text-2); font-weight: var(--fw-regular); }
.notif-all-ic { color: var(--text-2); }

/* ---- #/notifications page (UX-035): one centred feed column, 320-480px; progress card beside it ---- */
:root {
  --notif-col-w: 480px;
  --notif-line: #c9ccd3;
  --notif-feed-dot: #2c75d9;
  --notif-gutter: 24px;       /* line + dot column on the left of the feed */
  --notif-chip-on-bg: #e3eeff;
  --notif-chip-on-text: #0e69c4;
}
.notif-page {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, var(--notif-col-w)) minmax(0, 1fr);
  column-gap: var(--sp-7); align-items: start;
}
.notif-col { grid-column: 2; min-width: 0; display: flex; flex-direction: column; }
.notif-side { grid-column: 3; width: 320px; max-width: 100%; position: sticky; top: var(--sp-6); }
@media (max-width: 1240px) {
  .notif-page { grid-template-columns: minmax(0, 1fr); justify-items: center; row-gap: var(--sp-6); }
  .notif-col, .notif-side { grid-column: 1; width: 100%; max-width: var(--notif-col-w); }
  .notif-side { position: static; grid-row: 1; }
}

/* One 40px row: Mark all as read | All Updates Activities Mentions Emails */
.notif-toolbar { display: flex; align-items: center; gap: var(--sp-4); height: 40px; min-width: 0; }
.notif-read-all.btn { height: 28px; padding: 0 var(--sp-4); gap: var(--sp-2); font-size: var(--fs-sm); flex: none; }
.notif-read-all .ic, .notif-read-all .ic svg { width: 14px; height: 14px; }
.notif-sep { width: 1px; height: 20px; background: var(--border); flex: none; }
.notif-chips { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; overflow-x: auto; scrollbar-width: none; }
.notif-chip {
  height: 28px; padding: 0 var(--sp-4); border: 0; border-radius: var(--r-sm); background: none; flex: none;
  color: var(--text-2); font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-semibold); cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.notif-chip:hover { background: var(--bg-hover); color: var(--text); }
.notif-chip:focus-visible { outline: 2px solid var(--border-focus); outline-offset: -2px; }
.notif-chip[aria-pressed='true'] { background: var(--notif-chip-on-bg); color: var(--notif-chip-on-text); }
.notif-sub { display: flex; justify-content: flex-end; min-height: 16px; margin-bottom: var(--sp-3); }
.notif-page-unread { color: var(--text-2); font-size: var(--fs-sm); line-height: 16px; }

/* Timeline: solid 2px line, a 10px blue dot per item, day pills centred on the line. */
.notif-feed { position: relative; display: flex; flex-direction: column; gap: var(--sp-4); padding-left: var(--notif-gutter); }
.notif-feed[data-loaded='1']::before {
  content: ""; position: absolute; left: 7px; top: 10px; bottom: var(--sp-4); width: 2px;
  background: var(--notif-line); border-radius: 1px;
}
.notif-day { position: relative; z-index: 1; height: 20px; margin: var(--sp-4) 0 var(--sp-1) calc(-1 * var(--notif-gutter)); }
.notif-day:first-child { margin-top: 0; }
.notif-day-pill {
  position: absolute; left: 8px; top: 0; transform: translateX(-50%); white-space: nowrap;
  padding: 0 var(--sp-4); height: 20px; line-height: 20px; border-radius: var(--r-pill);
  background: var(--label-darkgrey); color: var(--text-inverse); font-size: var(--fs-xs); font-weight: var(--fw-semibold);
  letter-spacing: 0.3px;
}
.notif-feed-row { position: relative; min-width: 0; }
.notif-feed-dot {
  position: absolute; left: calc(-1 * var(--notif-gutter) + 3px); top: 18px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--notif-feed-dot); box-shadow: 0 0 0 3px var(--bg-surface); z-index: 1;
}
.notif-feed-row.is-missing .notif-feed-dot { top: 17px; }
/* Feed items: no card, 16px padding, a soft hover. */
.notif-feed-row .notif-item { padding: var(--sp-5) var(--sp-6); border-radius: var(--r-md); }
.notif-feed-row .notif-item:hover { background: var(--bg-hover); }
.notif-none { padding: var(--sp-6) var(--sp-6); }
.notif-more { align-self: center; margin-top: var(--sp-5); }
.notif-more[hidden] { display: none; }

/* MISSING ACTIVITY card: pale red header, a row per deal */
.missing-card { padding: 0; overflow: hidden; }
.missing-head {
  display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-5) var(--sp-6);
  background: var(--missing-head-bg); color: var(--missing-head-text);
  font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: 0.2px;
}
.missing-head .ic, .missing-head .ic svg { width: 18px; height: 18px; }
.missing-count {
  min-width: 22px; height: 20px; padding: 0 var(--sp-3); border-radius: var(--r-pill);
  background: var(--bg-surface); color: var(--missing-head-text); font-size: var(--fs-sm); line-height: 20px; text-align: center;
}
.missing-time { margin-left: auto; font-size: var(--fs-sm); font-weight: var(--fw-regular); text-transform: none; letter-spacing: 0; }
.missing-menu-btn {
  width: 28px; height: 28px; margin: -4px -6px -4px 0; border: 0; border-radius: var(--r-sm); background: none; flex: none;
  color: var(--text-2); display: grid; place-items: center; cursor: pointer;
}
.missing-menu-btn:hover, .missing-menu-btn[aria-expanded='true'] { background: rgba(0, 0, 0, 0.06); color: var(--text); }
.missing-menu-btn:focus-visible { outline: 2px solid var(--border-focus); outline-offset: -2px; }
.missing-menu-btn .ic, .missing-menu-btn .ic svg { width: 16px; height: 16px; display: block; }
.popover.missing-menu-pop { min-width: 180px; }
.missing-card > .notif-empty { padding: var(--sp-5) var(--sp-6); }
.missing-list { max-height: 520px; overflow-y: auto; }
.missing-row { padding: var(--sp-5) var(--sp-6); display: flex; flex-direction: column; gap: var(--sp-3); }
.missing-row + .missing-row { border-top: 1px solid var(--border); }
.missing-row-top { display: flex; align-items: center; gap: var(--sp-4); }
.missing-title {
  flex: 1; min-width: 0; color: var(--text); font-weight: var(--fw-semibold);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.missing-add {
  display: inline-flex; align-items: center; gap: var(--sp-2); padding: var(--sp-1) var(--sp-3); border: 0; border-radius: var(--r-sm);
  background: none; color: var(--link); font-weight: var(--fw-semibold); cursor: pointer; flex: none;
}
.missing-add:hover { background: var(--bg-info); }
.missing-add .ic, .missing-add .ic svg { width: 12px; height: 12px; }
.missing-meta { display: flex; align-items: center; gap: var(--sp-5); color: var(--text-2); font-size: var(--fs-sm); }
.missing-person { display: inline-flex; align-items: center; gap: var(--sp-2); }
.missing-stages { display: flex; gap: 2px; height: 12px; }
.missing-stage { flex: 1; background: var(--stage-todo); clip-path: polygon(0 0, calc(100% - 5px) 0, 100% 50%, calc(100% - 5px) 100%, 0 100%, 5px 50%); }
.missing-stage:first-child { clip-path: polygon(0 0, calc(100% - 5px) 0, 100% 50%, calc(100% - 5px) 100%, 0 100%); border-radius: var(--r-pill) 0 0 var(--r-pill); }
.missing-stage.is-done { background: var(--stage-done); }
.missing-hint { color: var(--missing-head-text); font-size: var(--fs-sm); }

@media (prefers-reduced-motion: reduce) {
  .notif-panel, .notif-chip { transition: none; }
}
