/* System notifications are visually separate from channel conversation replies. */
.notifications-wrap { position: relative; }
.notifications-button {
  align-items: center;
  background: #fff;
  border: 1px solid var(--console-border, #d0d5dd);
  border-radius: 6px;
  color: #475467;
  cursor: pointer;
  display: inline-flex;
  height: 2.25rem;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0;
  position: relative;
  width: 2.25rem;
}
.notifications-button:hover { background: #f9fafb; border-color: #98a2b3; color: #182230; }
.notifications-button svg { fill: none; height: 1.15rem; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 1.15rem; }
.notifications-badge { align-items: center; background: #d92d20; border: 2px solid #fff; border-radius: 999px; color: #fff; display: inline-flex; font-size: 0.6rem; font-weight: 700; height: 1.05rem; justify-content: center; line-height: 1; min-width: 1.05rem; padding: 0 0.2rem; position: absolute; right: -0.42rem; top: -0.42rem; }
.notifications-panel { background: #fff; border: 1px solid var(--console-border, #d0d5dd); border-radius: 8px; box-shadow: 0 20px 48px rgba(16, 24, 40, 0.18); overflow: hidden; position: absolute; right: 0; top: calc(100% + 0.55rem); width: min(25rem, calc(100vw - 2rem)); z-index: 80; }
.notifications-panel-head { align-items: center; border-bottom: 1px solid #e4e7ec; display: flex; justify-content: space-between; min-height: 4rem; padding: 0.75rem 1rem; }
.notifications-panel-head > div { display: grid; gap: 0.12rem; }
.notifications-panel-head strong { color: #182230; font-size: 0.95rem; line-height: 1.35; }
.notifications-panel-head small { color: #667085; font-size: 0.7rem; }
.notifications-panel-head button { background: transparent; border: 0; border-radius: 4px; box-shadow: none; color: #175cd3; cursor: pointer; font-size: 0.75rem; min-height: 2rem; padding: 0 0.45rem; }
.notifications-panel-head button:hover:not(:disabled) { background: #eff4ff; box-shadow: none; transform: none; }
.notifications-panel-head button:disabled { color: #98a2b3; cursor: default; }
.notifications-list { display: flex; flex-direction: column; max-height: min(28rem, calc(100vh - 7rem)); overflow-y: auto; }
button.notification-row { background: #fff; border: 0; border-bottom: 1px solid #eaecf0; border-radius: 0; box-shadow: none; color: #344054; cursor: pointer; display: flex; flex-direction: column; gap: 0.45rem; min-height: 0; padding: 0.9rem 1rem; text-align: left; width: 100%; }
button.notification-row:last-child { border-bottom: 0; }
button.notification-row:hover { background: #f9fafb; box-shadow: none; transform: none; }
button.notification-row.is-unread { background: #f5f8ff; box-shadow: inset 3px 0 0 #2e90fa; }
button.notification-row.is-unread:hover { background: #eff4ff; }
.notification-row-head { align-items: center; display: flex; gap: 0.75rem; justify-content: space-between; width: 100%; }
.notification-row-head strong { color: #182230; font-size: 0.82rem; font-weight: 650; line-height: 1.35; }
.notification-read-state { background: #f2f4f7; border-radius: 999px; color: #667085; flex: 0 0 auto; font-size: 0.63rem; font-weight: 650; padding: 0.15rem 0.4rem; }
.is-unread .notification-read-state { background: #dbeafe; color: #175cd3; }
.notification-row-body { color: #475467; display: -webkit-box; font-size: 0.76rem; line-height: 1.55; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.notification-row-time { color: #98a2b3; font-size: 0.66rem; }
.notifications-empty { align-items: center; color: #667085; display: flex; flex-direction: column; gap: 0.25rem; justify-content: center; min-height: 11rem; padding: 1.5rem; text-align: center; }
.notifications-empty > span { align-items: center; background: #f2f4f7; border-radius: 50%; color: #667085; display: inline-flex; height: 2.25rem; justify-content: center; margin-bottom: 0.25rem; width: 2.25rem; }
.notifications-empty strong { color: #344054; font-size: 0.82rem; }
.notifications-empty small { font-size: 0.72rem; }

/* Account quota popover */
.quota-popover {
  background: var(--console-surface, var(--admin-surface, #fff));
  border: 1px solid var(--console-border, var(--admin-border, #e4e7ec));
  border-radius: 6px;
  box-shadow: 0 18px 48px rgba(16, 24, 40, 0.18);
  box-sizing: border-box;
  color: var(--console-ink, var(--admin-ink, #182230));
  max-height: calc(100vh - 4.25rem);
  overflow: auto;
  padding: 0;
  position: fixed;
  right: 1.25rem;
  top: 3.7rem;
  width: min(26rem, calc(100vw - 2rem));
  z-index: 80;
}

.quota-popover-header {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin: 0;
  padding: 1rem 1rem 0.85rem;
}

.quota-popover-header h2 {
  font-size: 1rem;
  line-height: 1.35;
  margin: 0;
}

.quota-account-email {
  color: var(--console-muted, var(--admin-muted, #667085));
  font-size: 0.75rem;
  margin: 0.2rem 0 0;
  overflow-wrap: anywhere;
}

button.quota-popover-close {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 4px;
  box-shadow: none;
  color: #667085;
  display: inline-flex;
  flex: 0 0 2rem;
  font-size: 1.25rem;
  height: 2rem;
  justify-content: center;
  min-height: 2rem;
  padding: 0;
  width: 2rem;
}

button.quota-popover-close:hover {
  background: #f2f4f7;
  box-shadow: none;
  color: #182230;
  transform: none;
}

.quota-account-strip {
  align-items: center;
  background: #f9fafb;
  border-bottom: 1px solid var(--console-border, var(--admin-border, #e4e7ec));
  border-top: 1px solid var(--console-border, var(--admin-border, #e4e7ec));
  color: var(--console-muted, var(--admin-muted, #667085));
  display: flex;
  font-size: 0.75rem;
  gap: 0.45rem;
  min-height: 2.6rem;
  padding: 0 1rem;
}

.quota-account-strip strong {
  color: var(--console-ink, var(--admin-ink, #182230));
  font-weight: 650;
}

.quota-status {
  background: #ecfdf3;
  border-radius: 999px;
  color: #027a48;
  font-size: 0.68rem;
  font-weight: 650;
  margin-left: auto;
  padding: 0.18rem 0.45rem;
  white-space: nowrap;
}

.quota-status[data-kind="warning"] { background: #fffaeb; color: #b54708; }
.quota-status[data-kind="danger"] { background: #fef3f2; color: #b42318; }
.quota-status[data-kind="loading"] { background: #f2f4f7; color: #667085; }

.quota-section {
  border-bottom: 1px solid var(--console-border, var(--admin-border, #e4e7ec));
  padding: 0.9rem 1rem;
}

.quota-section:last-child { border-bottom: 0; }

.quota-section-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.quota-section-heading h3 {
  font-size: 0.78rem;
  font-weight: 650;
  margin: 0;
}

.quota-section-heading > strong {
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.quota-meter {
  background: #eaecf0;
  border-radius: 999px;
  height: 0.35rem;
  overflow: hidden;
  width: 100%;
}

.quota-meter > span {
  background: var(--console-accent, var(--admin-accent, #2563eb));
  display: block;
  height: 100%;
  min-width: 0;
  transition: width 180ms ease;
}

.quota-meter > span[data-kind="warning"] { background: #f79009; }
.quota-meter > span[data-kind="danger"] { background: #f04438; }

.quota-section-note {
  color: var(--console-muted, var(--admin-muted, #667085));
  font-size: 0.72rem;
  line-height: 1.45;
  margin: 0.5rem 0 0;
}

.quota-usage-list { display: grid; gap: 0.7rem; }

.quota-usage-row > div:first-child {
  align-items: center;
  display: flex;
  font-size: 0.73rem;
  justify-content: space-between;
  margin-bottom: 0.3rem;
}

.quota-usage-row span { color: var(--console-muted, var(--admin-muted, #667085)); }
.quota-usage-row strong { font-size: 0.75rem; font-variant-numeric: tabular-nums; }

.quota-limit-grid {
  display: grid;
  gap: 0.5rem 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.quota-limit-grid > div {
  border-left: 2px solid #dbe7ff;
  min-width: 0;
  padding-left: 0.55rem;
}

.quota-limit-grid dt {
  color: var(--console-muted, var(--admin-muted, #667085));
  font-size: 0.68rem;
  line-height: 1.3;
}

.quota-limit-grid dd {
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  margin: 0.12rem 0 0;
}

@media (max-width: 560px) {
  .quota-popover { right: 0.65rem; top: 3.55rem; width: calc(100vw - 1.3rem); }
}

/* Analytics panel */
.analytics-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 18px; }
.analytics-metric { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--border, #e2e8f0); border-radius: 12px; background: var(--surface, #fff); }
.analytics-metric-value { font-size: 24px; font-weight: 700; }
.analytics-metric-label { font-size: 12px; color: var(--muted, #94a3b8); }
.analytics-top-pages { display: flex; flex-direction: column; }
.analytics-page-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 4px; border-bottom: 1px solid var(--border, #f1f5f9); }

/* Admin sampling control */
.sampling-control { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
.sampling-control input[type="range"] { flex: 1; max-width: 320px; }
.sampling-control #sampling-value { min-width: 48px; font-weight: 700; font-variant-numeric: tabular-nums; }
