/* Arbah v2 — Notifications surface.
   Scope all rules under .arbah-v2 ; RTL falls out of logical properties
   (inset-inline / margin-inline / text-align:start) plus .arbah-v2[dir="rtl"]
   where a value must mirror. Tokens + primitives only — no new globals.
   Consumed by src/pages/Notifications.js (NotificationsV2) and
   src/components/notifications/NotificationRow.js. */

/* ---------- Page shell --------------------------------------- */
.arbah-v2 .notif-v2-page {
  max-width: 760px;
  margin-inline: auto;
  padding: 20px 16px 48px;
  font-family: var(--arbah-v2-font-sans);
  color: var(--arbah-v2-ink);
}

/* ---------- Header (card-hero + brand ribbon) ---------------- */
.arbah-v2 .notif-v2-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-block-end: 16px;
}
.arbah-v2 .notif-v2-header-main {
  min-width: 0;
}
.arbah-v2 .notif-v2-header .page-title {
  margin-block-end: 6px;
}

/* Live count summary — mono + tabular so digits don't jitter. The dot
   separators use logical layout so the row reverses cleanly in RTL. */
.arbah-v2 .notif-v2-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--arbah-v2-font-mono);
  font-size: 12.5px;
  color: var(--arbah-v2-ink-muted);
}
.arbah-v2 .notif-v2-summary-item {
  white-space: nowrap;
}
.arbah-v2 .notif-v2-dot {
  color: var(--arbah-v2-ink-subtle);
}
.arbah-v2 .notif-v2-num {
  font-family: var(--arbah-v2-font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  font-weight: 600;
  color: var(--arbah-v2-ink);
  unicode-bidi: isolate;
}

.arbah-v2 .notif-v2-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ---------- Tab bar ------------------------------------------ */
.arbah-v2 .notif-v2-tabs {
  margin-block-end: 16px;
  border-radius: var(--arbah-v2-radius-md);
}
/* Count chip sits after the tab label; nudge it tighter to the text. */
.arbah-v2 .notif-v2-tabs .tab-bar-item > .chip {
  margin-inline-start: 2px;
}

/* ---------- Date groups -------------------------------------- */
.arbah-v2 .notif-v2-groups {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.arbah-v2 .notif-v2-group-label {
  font-family: var(--arbah-v2-font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--arbah-v2-ink-subtle);
  text-align: start;
  margin-block-end: 8px;
}
.arbah-v2 .notif-v2-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ---------- Row ---------------------------------------------- */
.arbah-v2 .notif-v2-row {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  text-align: start;
  padding: 12px 14px;
  padding-inline-start: 18px;          /* room for the unread ribbon */
  background: var(--arbah-v2-surface);
  border: 1px solid var(--arbah-v2-border);
  border-radius: var(--arbah-v2-radius-lg);
  box-shadow: var(--arbah-v2-shadow-sm);
  cursor: pointer;
  font-family: var(--arbah-v2-font-sans);
  transition: background-color 120ms cubic-bezier(.2, 0, 0, 1),
              border-color 120ms cubic-bezier(.2, 0, 0, 1),
              box-shadow 120ms cubic-bezier(.2, 0, 0, 1);
}
.arbah-v2 .notif-v2-row:hover {
  border-color: var(--arbah-v2-border-strong);
  box-shadow: var(--arbah-v2-shadow-md);
}

/* Read rows recede — sunken surface + muted ink, no opacity hacks so the
   text stays legible. */
.arbah-v2 .notif-v2-row--read {
  background: var(--arbah-v2-surface-sunken);
  box-shadow: none;
}
.arbah-v2 .notif-v2-row--read .notif-v2-title {
  font-weight: 500;
  color: var(--arbah-v2-ink-muted);
}

/* Unread ribbon — brand bar hugging the inline-start edge, mirrored in
   RTL for free via inset-inline-start. */
.arbah-v2 .notif-v2-ribbon {
  position: absolute;
  inset-inline-start: 0;
  inset-block: 10px;
  inline-size: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--arbah-v2-brand);
}
.arbah-v2[dir="rtl"] .notif-v2-ribbon {
  border-radius: 3px 0 0 3px;
}

/* ---------- Avatar ------------------------------------------- */
.arbah-v2 .notif-v2-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 36px;
  block-size: 36px;
  border-radius: 999px;
  flex: 0 0 auto;
  background: var(--arbah-v2-surface-sunken);
  color: var(--arbah-v2-ink-muted);
}
.arbah-v2 .notif-v2-avatar--info    { background: var(--arbah-v2-info-soft);    color: var(--arbah-v2-info); }
.arbah-v2 .notif-v2-avatar--success { background: var(--arbah-v2-success-soft); color: var(--arbah-v2-success); }
.arbah-v2 .notif-v2-avatar--warning { background: var(--arbah-v2-warning-soft); color: var(--arbah-v2-warning); }
.arbah-v2 .notif-v2-avatar--danger  { background: var(--arbah-v2-danger-soft);  color: var(--arbah-v2-danger); }

/* ---------- Body --------------------------------------------- */
.arbah-v2 .notif-v2-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
}
.arbah-v2 .notif-v2-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.arbah-v2 .notif-v2-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--arbah-v2-ink);
}
.arbah-v2 .notif-v2-time {
  flex: 0 0 auto;
  font-family: var(--arbah-v2-font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  font-size: 11px;
  color: var(--arbah-v2-ink-subtle);
  unicode-bidi: isolate;
}
.arbah-v2 .notif-v2-message {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--arbah-v2-ink-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.arbah-v2 .notif-v2-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-block-start: 2px;
}

/* ---------- Skeleton / error / empty ------------------------- */
.arbah-v2 .notif-v2-skeleton {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.arbah-v2 .notif-v2-skeleton-row {
  block-size: 64px;
  border-radius: var(--arbah-v2-radius-lg);
  background: linear-gradient(90deg,
    var(--arbah-v2-surface-sunken) 25%,
    var(--arbah-v2-surface-raised) 37%,
    var(--arbah-v2-surface-sunken) 63%);
  background-size: 400% 100%;
  animation: notif-v2-shimmer 1.4s ease infinite;
}
@keyframes notif-v2-shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

.arbah-v2 .notif-v2-error {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--arbah-v2-danger);
  border-radius: var(--arbah-v2-radius-lg);
  background: var(--arbah-v2-danger-soft);
  color: var(--arbah-v2-danger);
  font-size: 13px;
}

.arbah-v2 .notif-v2-empty {
  margin-block-start: 8px;
}

/* ---------- Phone ------------------------------------------- */
@media (max-width: 560px) {
  .arbah-v2 .notif-v2-header-actions {
    inline-size: 100%;
  }
  .arbah-v2 .notif-v2-header-actions .btn {
    inline-size: 100%;
  }
}
