/* Client notifications: the topbar bell, its panel and popup (bos-notifications.js), the Notifications page and
   the administrator screen. docs/2026-09-25_client-notifications-redesign.md */

/* ---- bell ----------------------------------------------------------------------------------- */
.bnt-bell{position:relative;display:inline-flex}
.bnt-button{position:relative;display:inline-grid;place-items:center}
.bnt-button[aria-expanded=true]{background:var(--surface-2);color:var(--bos-blue)}
.bnt-button.is-new svg{animation:bnt-ring .9s ease-in-out 2;transform-origin:50% 3px}
@keyframes bnt-ring{0%,100%{transform:rotate(0)}15%{transform:rotate(15deg)}30%{transform:rotate(-13deg)}45%{transform:rotate(9deg)}60%{transform:rotate(-6deg)}75%{transform:rotate(3deg)}}

/* ---- panel (the bell's dropdown) ------------------------------------------------------------ */
.bnt-panel{position:absolute;right:-6px;top:calc(100% + 10px);z-index:10060;width:380px;max-width:calc(100vw - 20px);max-height:min(560px,calc(100vh - 90px));display:flex;flex-direction:column;background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:12px;box-shadow:0 14px 40px rgba(12,40,60,.22);overflow:hidden;font-size:13px;text-align:left}
.bnt-panel[hidden]{display:none}
.bnt-panel-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 14px;border-bottom:1px solid var(--border)}
.bnt-panel-head strong{font-size:14px}
.bnt-link{border:0;background:none;padding:0;color:var(--bos-blue);font-weight:700;font-size:12px;cursor:pointer}
.bnt-link:hover{text-decoration:underline}
.bnt-panel-list{overflow:auto;flex:1;overscroll-behavior:contain}
.bnt-item{display:flex;gap:10px;padding:11px 14px;border-bottom:1px solid var(--border);cursor:pointer}
.bnt-item:last-child{border-bottom:0}
.bnt-item:hover{background:var(--surface-2)}
.bnt-item:focus-visible{outline:2px solid var(--bos-blue);outline-offset:-2px}
.bnt-item.is-unread{background:color-mix(in srgb,var(--bos-blue) 6%,var(--surface))}
.bnt-item.is-unread:hover{background:color-mix(in srgb,var(--bos-blue) 10%,var(--surface))}
.bnt-dot{flex:none;width:8px;height:8px;margin-top:6px;border-radius:50%}
.bnt-item.is-unread .bnt-dot{background:var(--bos-blue)}
.bnt-item-main{min-width:0;flex:1}
.bnt-item-top{display:flex;align-items:baseline;justify-content:space-between;gap:8px}
.bnt-item-title{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bnt-item.is-unread .bnt-item-title{font-weight:800}
.bnt-item-when{flex:none;color:var(--muted);font-size:11px}
.bnt-item-text{margin-top:3px;color:var(--muted);white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.bnt-item.is-expanded .bnt-item-text{display:block;overflow:visible;color:var(--text)}
.bnt-item .bnt-link{margin-top:6px}
.bnt-empty{padding:34px 16px;text-align:center;color:var(--muted);line-height:1.6}
.bnt-panel-foot{padding:10px 14px;border-top:1px solid var(--border);text-align:center;background:var(--surface-2)}
.bnt-panel-foot a{color:var(--bos-blue);font-weight:700;font-size:12px}
.bnt-panel-foot a:hover{text-decoration:underline}
.bnt-panel .bnt-error{margin:10px 14px 0}

/* ---- popup (a new message, under the bell) -------------------------------------------------- */
.bnt-popup{position:fixed;top:calc(var(--topbar-height) + 10px);right:16px;z-index:10055;width:410px;max-width:calc(100vw - 32px);background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:12px;box-shadow:0 18px 48px rgba(12,40,60,.28);overflow:hidden;font-size:13px;animation:bnt-in .18s ease-out}
.bnt-popup[hidden]{display:none}
@keyframes bnt-in{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}
.bnt-popup-head{display:flex;align-items:center;gap:8px;padding:10px 12px;background:var(--bos-blue);color:#fff}
.bnt-popup-head svg{width:17px;height:17px;flex:none;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.bnt-popup-head strong{flex:1;font-size:12.5px}
.bnt-popup-count{font-size:11px;font-weight:700;opacity:.92;font-variant-numeric:tabular-nums}
.bnt-popup-close{border:0;background:rgba(255,255,255,.16);color:#fff;border-radius:6px;width:28px;height:26px;font-size:17px;line-height:1;cursor:pointer}
.bnt-popup-close:hover{background:rgba(255,255,255,.3)}
.bnt-popup-body{padding:14px 16px 4px}
.bnt-popup-title{margin:0;font-size:16px;line-height:1.3;overflow-wrap:anywhere}
.bnt-popup-when{display:block;margin-top:3px;color:var(--muted);font-size:11px}
.bnt-popup-message{margin-top:10px;max-height:min(300px,45vh);overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.55}
.bnt-popup-message a,.bnt-item-text a,.bnt-inbox-message a,.bnt-message-box a{color:var(--bos-blue);text-decoration:underline}
.bnt-popup-actions{display:flex;align-items:center;gap:8px;padding:12px 16px 14px}
.bnt-spacer{flex:1}
.bnt-nav{border:1px solid var(--border);background:var(--surface);color:var(--text);border-radius:7px;width:32px;height:32px;font-size:17px;line-height:1;cursor:pointer}
.bnt-nav:hover:not(:disabled){background:var(--surface-2)}
.bnt-nav:disabled{opacity:.4;cursor:default}
.bnt-error{margin:6px 16px 0;padding:8px 10px;border-radius:7px;background:color-mix(in srgb,var(--danger) 10%,var(--surface));color:var(--danger);font-size:12px}
@media (max-width:560px){
  .bnt-popup{right:8px;left:8px;width:auto;max-width:none}
  .bnt-panel{position:fixed;left:8px;right:8px;top:calc(var(--topbar-height) + 6px);width:auto;max-width:none}
}
@media (prefers-reduced-motion:reduce){.bnt-button.is-new svg,.bnt-popup{animation:none}}

/* ---- Notifications page --------------------------------------------------------------------- */
.bnt-inbox{max-width:900px;margin:0 auto}
.bnt-inbox-bar{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px;flex-wrap:wrap}
.bnt-seg{display:inline-flex;border:1px solid var(--border);border-radius:8px;overflow:hidden;background:var(--surface)}
.bnt-seg button{border:0;background:transparent;color:var(--text);padding:7px 13px;font-size:12px;font-weight:700;cursor:pointer}
.bnt-seg button+button{border-left:1px solid var(--border)}
.bnt-seg button[aria-pressed=true]{background:var(--bos-blue);color:#fff}
.bnt-inbox-list{display:grid;gap:10px}
.bnt-inbox-item{padding:16px 18px;border-left:4px solid transparent}
.bnt-inbox-item.is-unread{border-left-color:var(--bos-blue)}
.bnt-inbox-item[hidden]{display:none}
.bnt-inbox-head{display:flex;justify-content:space-between;align-items:baseline;gap:12px}
.bnt-inbox-head h2{margin:0;font-size:16px;line-height:1.35;overflow-wrap:anywhere}
.bnt-inbox-item.is-unread .bnt-inbox-head h2::before{content:"";display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--bos-blue);margin-right:8px;vertical-align:.15em}
.bnt-inbox-when{flex:none;color:var(--muted);font-size:12px}
.bnt-inbox-message{margin:8px 0 0;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.55}
.bnt-inbox-foot{display:flex;align-items:center;gap:10px;margin-top:12px;font-size:12px;color:var(--muted)}
.bnt-inbox-empty{padding:40px 20px;text-align:center;color:var(--muted)}
.bnt-new-pill{padding:2px 8px;border-radius:999px;background:var(--bos-blue);color:#fff;font-size:10px;font-weight:800;letter-spacing:.03em}

/* ---- administrator screen ------------------------------------------------------------------- */
.bnt-compose-grid{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(340px,1fr);gap:14px;align-items:stretch;margin:0 0 14px;padding:0;border:0;min-width:0}
.bnt-compose-grid:disabled{opacity:.6}
.bnt-compose{padding:0 18px 18px;display:flex;flex-direction:column}
.bnt-compose .admin-field textarea{min-height:150px;line-height:1.5;font:inherit;font-size:14px}
.bnt-compose .admin-field input{font-size:14px}
.bnt-compose .btn,.bnt-receipts-head .btn,.bnt-inbox .btn,.bnt-popup .btn{font-size:13px}
.bnt-field-foot{display:flex;justify-content:flex-end;font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums}
.bnt-field-foot.is-near{color:#b87300;font-weight:700}
.bnt-compose-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:auto;padding-top:14px;border-top:1px solid var(--border);flex-wrap:wrap}
.bnt-audience{margin:0;color:var(--muted);font-size:12px;line-height:1.4;flex:1;min-width:200px}
.bnt-preview{margin:14px 0 16px;padding:12px 14px 14px;display:flex;flex-direction:column;gap:9px;background:var(--surface-2);border:1px solid var(--border);border-radius:10px}
.bnt-preview-label{font-size:10px;font-weight:900;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.bnt-preview .bnt-popup{position:static;width:auto;max-width:430px;animation:none;box-shadow:var(--shadow);z-index:auto}
.bnt-preview .bnt-popup .btn{pointer-events:none}
.bnt-preview .is-placeholder{color:var(--muted);font-style:italic;font-weight:500}

.bnt-recipients{display:flex;flex-direction:column;min-height:0;overflow:hidden}
.bnt-recipients-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:14px 14px 10px}
.bnt-recipients-head h2{margin:0;font-size:17px}
.bnt-recipients-head p{margin:3px 0 0;color:var(--muted);font-size:12px}
.bnt-picked{flex:none;padding:4px 10px;border-radius:999px;background:var(--bos-blue);color:#fff;font-size:12px;font-weight:800;font-variant-numeric:tabular-nums}
.bnt-picked.is-empty{background:var(--surface-2);color:var(--muted);border:1px solid var(--border)}
.bnt-recipients-tools{display:flex;flex-direction:column;gap:8px;padding:0 14px 10px}
.bnt-recipients-tools .tree-search{margin:0;width:100%;height:36px}
.bnt-seg-wrap{flex-wrap:wrap}
.bnt-seg-wrap button{padding:6px 10px;font-size:11.5px}
.bnt-recipients-actions{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:12px}
.bnt-recipient-list{flex:1;min-height:220px;max-height:560px;overflow:auto;border-top:1px solid var(--border)}
.bnt-recipient{display:flex;align-items:flex-start;gap:10px;padding:9px 14px;border-bottom:1px solid var(--border);cursor:pointer}
.bnt-recipient[hidden]{display:none}
.bnt-recipient:hover{background:var(--surface-2)}
.bnt-recipient.is-picked{background:color-mix(in srgb,var(--bos-blue) 8%,var(--surface))}
.bnt-recipient input{margin-top:3px;width:16px;height:16px;flex:none;accent-color:var(--bos-blue)}
.bnt-recipient-main{display:flex;flex-direction:column;gap:4px;min-width:0;flex:1}
.bnt-recipient-top{display:flex;gap:8px;align-items:baseline;min-width:0;font-size:13px}
.bnt-recipient-top strong{flex:none}
.bnt-recipient-top span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bnt-recipient-meta{display:flex;flex-wrap:wrap;gap:5px}

.bnt-admin-grid{display:grid;grid-template-columns:minmax(280px,30%) minmax(0,1fr);gap:14px;align-items:start}
.bnt-sent{overflow:hidden;position:sticky;top:14px}
.bnt-sent>.tree-search{margin:0 12px 10px;width:calc(100% - 24px)}
.bnt-sent-list{max-height:calc(100vh - 230px);overflow:auto;border-top:1px solid var(--border)}
.bnt-sent-row{display:block;padding:11px 14px;border-bottom:1px solid var(--border);color:var(--text)}
.bnt-sent-row[hidden]{display:none}
.bnt-sent-row:hover{background:var(--surface-2)}
.bnt-sent-row.selected{background:color-mix(in srgb,var(--bos-blue) 11%,var(--surface));box-shadow:inset 3px 0 0 var(--bos-blue)}
.bnt-sent-top{display:flex;justify-content:space-between;gap:8px;align-items:baseline}
.bnt-sent-title{font-weight:750;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bnt-sent-row.is-withdrawn .bnt-sent-title{text-decoration:line-through;color:var(--muted)}
.bnt-sent-when{flex:none;font-size:11px;color:var(--muted)}
.bnt-progress{height:5px;border-radius:99px;background:var(--border);overflow:hidden;margin:8px 0 5px}
.bnt-progress>span{display:block;height:100%;min-width:0;background:var(--success);border-radius:inherit}
.bnt-sent-stats{display:flex;justify-content:space-between;gap:8px;font-size:11px;color:var(--muted)}
.bnt-sent-empty{padding:28px 16px;text-align:center;color:var(--muted);font-size:12px}

.bnt-receipts{padding:18px;min-width:0}
.bnt-receipts-head{display:flex;justify-content:space-between;gap:14px;align-items:flex-start}
.bnt-receipts-actions{display:flex;gap:8px;flex:none}
.bnt-receipts-head h2{margin:0;font-size:19px;line-height:1.3;overflow-wrap:anywhere}
.bnt-receipts-meta{margin-top:4px;color:var(--muted);font-size:12px}
.bnt-message-box{margin:14px 0;padding:12px 14px;border:1px solid var(--border);border-radius:9px;background:var(--surface-2);white-space:pre-wrap;line-height:1.55;overflow-wrap:anywhere;max-height:220px;overflow:auto}
.bnt-kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:16px}
.bnt-kpi{padding:12px 14px;border:1px solid var(--border);border-radius:10px;background:var(--surface);min-width:0}
.bnt-kpi>span{display:block;font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.05em;color:var(--muted)}
.bnt-kpi>strong{display:block;font-size:22px;line-height:1.2;margin-top:4px;font-variant-numeric:tabular-nums}
.bnt-kpi>strong small{font-size:13px;color:var(--muted);font-weight:700}
.bnt-kpi>small{display:block;color:var(--muted);font-size:11px;margin-top:2px}
.bnt-kpi .bnt-progress{margin:8px 0 0}
.bnt-receipts-filter{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:10px}
.bnt-receipts-filter .tree-search{margin:0;flex:1;min-width:180px;max-width:340px;height:34px}
.bnt-receipts .responsive-table{border:1px solid var(--border);border-radius:9px}
.bnt-receipts .data-table{min-width:640px}
.bnt-receipts .data-table td{white-space:normal;vertical-align:top}
.bnt-receipts .data-table tr[hidden]{display:none}
.bnt-cust strong{display:block}
.bnt-cust small{color:var(--muted)}
.bnt-pill{display:inline-flex;align-items:center;padding:3px 8px;border-radius:999px;font-size:10px;font-weight:800;white-space:nowrap}
.bnt-pill.ok{background:color-mix(in srgb,var(--success) 12%,var(--surface));color:var(--success)}
.bnt-pill.wait{background:color-mix(in srgb,#d78b00 14%,var(--surface));color:#b87300}
.bnt-pill.muted{background:var(--surface-2);color:var(--muted);border:1px solid var(--border)}
.bnt-pill.off{background:color-mix(in srgb,var(--danger) 10%,var(--surface));color:var(--danger)}
.bnt-pill.none{border:1px dashed var(--border);color:var(--muted)}
.bnt-sync-note{display:block;color:var(--muted);font-size:10.5px;margin-top:4px}
.bnt-readers{display:flex;flex-wrap:wrap;gap:6px}
.bnt-reader{display:inline-flex;flex-direction:column;padding:5px 9px;border:1px solid color-mix(in srgb,var(--success) 30%,var(--border));background:color-mix(in srgb,var(--success) 6%,var(--surface));border-radius:8px;font-size:12px;line-height:1.35;max-width:100%}
.bnt-reader strong{font-weight:750;overflow-wrap:anywhere}
.bnt-reader small{color:var(--muted);font-size:10.5px}
.bnt-not-read{color:var(--muted);font-style:italic;font-size:12px}
.bnt-receipts-empty{padding:40px 20px;text-align:center;color:var(--muted)}
@media (max-width:1100px){
  .bnt-compose-grid,.bnt-admin-grid{grid-template-columns:1fr}
  .bnt-recipient-list{max-height:420px}
  .bnt-sent{position:static}
  .bnt-sent-list{max-height:360px}
}
@media (max-width:640px){.bnt-kpis{grid-template-columns:1fr}.bnt-receipts-head{flex-direction:column}}
