/* Additional application-specific styles */
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Material Symbols base styling */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
vertical-align: middle;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #bcc9c6; border-radius: 10px; }

/* Sidebar section toggle */
.sidebar-section .sidebar-children { display: none; }
.sidebar-section.open .sidebar-children { display: block; }
.sidebar-section .chevron { transition: transform 150ms ease; }
.sidebar-section.open .chevron { transform: rotate(90deg); }

/* ============================================
   SIDEBAR COLLAPSED STATE
   ============================================ */

/* Smooth width transition */
.sidebar-panel {
  transition: width 200ms cubic-bezier(0.4, 0, 0.2, 1), transform 200ms ease-in-out;
}
.sidebar-panel.sidebar-collapsed {
  width: 3.5rem; /* 56px */
}

/* Hide all text labels when collapsed */
.sidebar-panel.sidebar-collapsed .sidebar-label { display: none; }

/* Center icons in collapsed nav */
.sidebar-panel.sidebar-collapsed nav {
  padding-left: 0.25rem;
  padding-right: 0.25rem;
  overflow: visible; /* allow tooltips and flyouts to escape nav bounds */
}
.sidebar-panel.sidebar-collapsed .nav-link,
.sidebar-panel.sidebar-collapsed .nav-button {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}
.sidebar-panel.sidebar-collapsed .sidebar-footer-inner {
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

/* Always hide section children when collapsed */
.sidebar-panel.sidebar-collapsed .sidebar-section .sidebar-children {
  display: none !important;
}

/* Rotate collapse icon when collapsed */
.sidebar-panel.sidebar-collapsed .sidebar-collapse-icon {
  transform: rotate(180deg);
}

/* Edge toggle: subtle unless hovering sidebar */
.sidebar-edge-toggle { opacity: 0.3; transition: opacity 150ms; }
.sidebar-panel:hover .sidebar-edge-toggle,
.sidebar-edge-toggle:hover { opacity: 1; }

/* ============================================
   SIDEBAR TOOLTIPS (standalone links)
   ============================================ */
.sidebar-tooltip {
  position: absolute;
  left: calc(100% + 0.625rem);
  top: 50%;
  transform: translateY(-50%);
  background: #0f172a;
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 0.375rem;
  white-space: nowrap;
  z-index: 200;
  border: 1px solid rgba(100, 116, 139, 0.25);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0s 100ms, opacity 100ms ease;
}
.sidebar-panel.sidebar-collapsed .sidebar-tooltip-wrapper:hover > .sidebar-tooltip {
  visibility: visible;
  opacity: 1;
  transition: visibility 0s, opacity 100ms ease;
}

/* ============================================
   SIDEBAR SECTION FLYOUTS (expandable sections)
   ============================================ */
.sidebar-flyout {
  position: absolute;
  left: calc(100% + 0.25rem);
  top: 0;
  background: #131b2e;
  border: 1px solid rgba(100, 116, 139, 0.25);
  border-radius: 0.5rem;
  padding: 0.375rem;
  min-width: 168px;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  visibility: hidden;
  opacity: 0;
  transition: visibility 0s 150ms, opacity 150ms ease;
}
/* Invisible bridge covers the gap so mouse can travel to the flyout */
.sidebar-flyout::before {
  content: '';
  position: absolute;
  left: -0.5rem;
  top: 0;
  width: 0.5rem;
  height: 100%;
}
.sidebar-panel.sidebar-collapsed .sidebar-flyout-wrapper:hover > .sidebar-flyout {
  visibility: visible;
  opacity: 1;
  transition: visibility 0s, opacity 150ms ease;
}
.sidebar-flyout-header {
  padding: 0.375rem 0.625rem 0.25rem;
  font-size: 9px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.sidebar-flyout a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.625rem;
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
  border-radius: 0.375rem;
  white-space: nowrap;
  transition: background 100ms, color 100ms;
}
.sidebar-flyout a:hover { background: rgba(255,255,255,0.06); color: #e2e8f0; }
.sidebar-flyout a.flyout-active { background: rgba(20,184,166,0.1); color: rgb(45,212,191); }

/* Toast notification animations */
.toast-item.toast-enter {
  transform: translateX(0);
  opacity: 1;
}

.toast-item.toast-exit {
  transform: translateX(100%);
  opacity: 0;
}

.toast-progress {
  transition: transform linear;
  transform-origin: left;
}

.toast-progress.toast-progress-running {
  transform: scaleX(0);
}

.toast-progress.toast-progress-paused {
  transition-play-state: paused;
}

/* ============================================
   STOCK DRAWER · history-flash
   Highlights a newly-prepended row in the in-drawer history list after
   a successful save_drawer commit. The Stimulus stock_drawer controller
   adds .history-flash to the first <li> in the drawer-history-{id} frame
   on turbo:submit-end success — the keyframe fades a teal tint to
   transparent so the operator's eye lands on the new entry.
   ============================================ */
@keyframes stock-history-flash {
  0%   { background-color: rgba(20, 184, 166, 0.18); }
  100% { background-color: transparent; }
}
.history-flash {
  animation: stock-history-flash 1400ms ease-out 1;
}

/* Visual lock state for Stock + Minimum inputs while the operator is
   recording a real loss. Read-only is enforced via the `readonly` HTML
   attribute set by Stimulus; this class adds the visual fade. */
.input-locked {
  background-color: rgba(15, 20, 25, 0.04);
  color: rgb(62, 74, 86);
  cursor: not-allowed;
}
.input-locked:focus {
  outline: none;
  box-shadow: none;
  border-color: rgba(15, 20, 25, 0.12);
}

/* Math chips — colored pill tokens that show the running stock calculation
   below the Stock + Minimum grid. Stimulus owns the textContent of each
   chip; visibility toggles via the `hidden` attribute. Compact padding +
   font-size keeps the row on a single line at the 360 px breakpoint. */
.chip-math {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.chip-math.chip-start  { background: rgb(233, 237, 241); color: rgb(62, 74, 86); }
.chip-math.chip-waste  { background: rgb(243, 232, 255); color: rgb(107, 33, 168); }
.chip-math.chip-manual { background: rgb(254, 243, 199); color: rgb(146, 64, 14); }
.chip-math.chip-result {
  background: rgb(240, 253, 250);
  color: rgb(13, 148, 136);
  border: 1px solid rgba(13, 148, 136, 0.22);
}

/* ============================================
   NOTIFICATIONS DRAWER
   Right-side panel, 400px desktop / 100vw mobile.
   Controlled by notifications_drawer_controller.js.
   ============================================ */

/* Scroll lock while drawer is open */
body.notifications-drawer-locked { overflow: hidden; }

/* ── Backdrop ── */
.notifications-drawer__backdrop {
  position: fixed;
  inset: 0;
  z-index: 498;
  background: transparent;
  border: none;
  cursor: default;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms cubic-bezier(0, 0, 0.2, 1);
}
.notifications-drawer__backdrop.is-open {
  background: rgba(0, 0, 0, 0.30);
  opacity: 1;
  pointer-events: all;
}

/* ── Drawer panel ── */
.notifications-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 400px;
  z-index: 499;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.10), -1px 0 0 rgba(188, 201, 198, 0.15);
  transform: translateX(110%);
  transition: transform 280ms cubic-bezier(0, 0, 0.2, 1);
  overflow: hidden;
}
.notifications-drawer.is-open {
  transform: translateX(0);
}

/* ── Header ── */
.notifications-drawer__header {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-bottom: 1px solid rgba(188, 201, 198, 0.15);
  flex-shrink: 0;
  background: #ffffff;
}
.notifications-drawer__header-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px 14px;
}
.notifications-drawer__titles {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.notifications-drawer__title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #191c1e;
  margin: 0;
}
.notifications-drawer__unread-pill {
  font-size: 11px;
  font-weight: 700;
  color: #00685f;
  background: rgba(0, 104, 95, 0.08);
  border-radius: 9999px;
  padding: 3px 10px;
  white-space: nowrap;
}
.notifications-drawer__header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.notifications-drawer__icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #3d4947;
  transition: background 120ms ease, color 120ms ease;
}
.notifications-drawer__icon-btn:hover {
  background: #eceef0;
  color: #191c1e;
}

/* ── List ── */
/* The list lives inside a turbo-frame which is inline by default;
   display:contents makes the frame transparent for layout so the OL
   becomes a direct flex child of the drawer aside and can scroll. */
turbo-frame#notifications-drawer-list-frame {
  display: contents;
}
.notifications-drawer__list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  margin: 0;
  padding: 0;
  list-style: none;
}
.notifications-drawer__list::-webkit-scrollbar { width: 4px; }
.notifications-drawer__list::-webkit-scrollbar-track { background: transparent; }
.notifications-drawer__list::-webkit-scrollbar-thumb {
  background: rgba(188, 201, 198, 0.40);
  border-radius: 2px;
}

/* ── Time-group sticky headers ── */
.notifications-drawer__group-header {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 6px 16px;
  background: rgba(242, 244, 246, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #565e74;
  border-bottom: 1px solid rgba(188, 201, 198, 0.15);
  list-style: none;
}

/* ── Empty state ── */
.notifications-drawer__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  gap: 8px;
  list-style: none;
}
.notifications-drawer__empty-icon {
  color: #3d4947;
  opacity: 0.28;
}
.notifications-drawer__empty-title {
  font-size: 14px;
  font-weight: 600;
  color: #191c1e;
  margin: 0;
}
.notifications-drawer__empty-body {
  font-size: 12px;
  color: #565e74;
  margin: 0;
  text-align: center;
}

/* ── Footer ── */
.notifications-drawer__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid rgba(188, 201, 198, 0.20);
  background: #ffffff;
  flex-shrink: 0;
}
.notifications-drawer__footer-btn {
  background: none;
  border: none;
  font-size: 12px;
  font-weight: 600;
  color: #565e74;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 120ms ease, color 120ms ease;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}
.notifications-drawer__footer-btn:hover {
  background: #eceef0;
  color: #191c1e;
}
.notifications-drawer__footer-link {
  font-size: 12px;
  font-weight: 700;
  color: #00685f;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 120ms ease;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}
.notifications-drawer__footer-link:hover {
  background: rgba(0, 104, 95, 0.06);
}

/* ── Mobile full-screen takeover (≤640px) ── */
@media (max-width: 640px) {
  .notifications-drawer {
    width: 100vw;
  }
  .notifications-drawer__backdrop {
    display: none;
  }
  .notifications-drawer__footer {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
}

/* ============================================
   NOTIFICATION ROW
   Used inside the drawer list. Position:relative
   wrapper holds the link (full body) + archive
   button (absolutely positioned, appears on hover).
   ============================================ */
/* ============================================
   NOTIFICATION LIST FRAME LOADER
   Turbo sets aria-busy="true" automatically during frame navigation.
   ============================================ */
turbo-frame#notifications-drawer-list-frame[aria-busy="true"] {
  position: relative;
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 120ms ease;
}
turbo-frame#notifications-drawer-list-frame[aria-busy="true"]::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border: 2px solid rgba(0, 104, 95, 0.18);
  border-top-color: #00685f;
  border-radius: 50%;
  animation: notif-spin 600ms linear infinite;
}
@keyframes notif-spin { to { transform: rotate(360deg); } }

/* ============================================
   NOTIFICATION ROW — full-row tint, solid icon
   Row tint follows priority color when unread.
   Read rows are plain white with muted typography.
   ============================================ */
.notification-row {
  position: relative;
  display: flex;
  align-items: stretch;
  min-height: 56px;
  background: #ffffff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: background 140ms ease;
  outline: none;
}
.notification-row:focus-visible {
  outline: 2px solid #00685f;
  outline-offset: -2px;
}

/* ── Priority tints applied to the WHOLE row when unread ── */
.notification-row.is-unread.notification-row--priority-urgent {
  background: rgba(220, 38, 38, 0.085);
}
.notification-row.is-unread.notification-row--priority-urgent:hover {
  background: rgba(220, 38, 38, 0.14);
}
.notification-row.is-unread.notification-row--priority-normal {
  background: rgba(217, 119, 6, 0.085);
}
.notification-row.is-unread.notification-row--priority-normal:hover {
  background: rgba(217, 119, 6, 0.14);
}
.notification-row.is-unread.notification-row--priority-info {
  background: rgba(0, 104, 95, 0.06);
}
.notification-row.is-unread.notification-row--priority-info:hover {
  background: rgba(0, 104, 95, 0.11);
}
.notification-row:not(.is-unread):hover {
  background: #f7f8f9;
}

/* ── Row content (icon + body) — covers the full clickable surface ── */
.notification-row__content {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 12px;
  padding: 12px 52px 12px 16px; /* right pad reserves space for the toggle btn */
  min-width: 0;
}

/* ── Icon container: SOLID priority color, white symbol ── */
.notification-row__icon-wrap {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  transition: background 140ms ease;
}
.notification-row__icon-wrap--urgent { background: #dc2626; }
.notification-row__icon-wrap--normal { background: #d97706; }
.notification-row__icon-wrap--info   { background: #00685f; }

/* Read state: icon container goes neutral gray, symbol mid-gray */
.notification-row:not(.is-unread) .notification-row__icon-wrap {
  background: #e5e7eb;
  color: #6b7280;
}

/* ── Body ── */
.notification-row__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.notification-row__title {
  font-size: 13px;
  line-height: 1.4;
  color: #191c1e;
  font-weight: 500;
  margin: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.notification-row.is-unread .notification-row__title {
  font-weight: 600;
  color: #0f1112;
}
.notification-row:not(.is-unread) .notification-row__title {
  color: #565e74;
}
.notification-row__meta {
  font-size: 11px;
  color: #3d4947;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.notification-row__actor {
  font-weight: 600;
  color: #3d4947;
}
.notification-row__time {
  opacity: 0.65;
}

/* ============================================
   NAVBAR BELL + NOTIFICATION BADGE (V3 "Campana llena")
   When there are unread notifications, the bell icon
   swaps from outlined to filled and shifts to the
   tenant primary color. A small red count pill sits
   in the upper-right. Pulse fires on every broadcast-
   replace of the #notification-badge span.
   ============================================ */
@keyframes notification-badge-pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}

/* Bell switches to filled + darker tint when the sibling badge
   exists and is non-empty (CSS :has() check). Color matches
   the navbar hover state so the cue feels native. */
.navbar-bell:has(.notification-badge:not(.is-empty)) .navbar-bell__icon {
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
  color: #191c1e;
}

.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  background: #dc2626;
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 1.5px solid #ffffff;
  line-height: 1;
  animation: notification-badge-pulse 240ms ease-out;
  box-shadow: 0 1px 2px rgba(220, 38, 38, 0.25);
}
.notification-badge.is-empty {
  display: none;
}
.notifications-drawer__unread-pill.is-empty {
  display: none;
}

/* ============================================
   NOTIFICATIONS INDEX (/notifications)
   Full-page view paired with the drawer styling.
   ============================================ */
.notifications-index {
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 0 32px;
}
.notifications-index__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.notifications-index__title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #191c1e;
  margin: 0;
}
.notifications-index__mark-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  background: #00685f;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  transition: background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
  box-shadow: 0 1px 2px rgba(0, 104, 95, 0.16);
}
.notifications-index__mark-all:hover {
  background: #005249;
  box-shadow: 0 2px 6px rgba(0, 104, 95, 0.24);
  transform: translateY(-1px);
}
.notifications-index__mark-all:focus-visible {
  outline: 2px solid #00685f;
  outline-offset: 2px;
}
.notifications-index__mark-all .material-symbols-outlined {
  color: inherit;
}

.notifications-index__list {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid rgba(188, 201, 198, 0.30);
  overflow: hidden;
}
.notifications-index__list .notification-row {
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}
.notifications-index__list .notification-row:last-child {
  border-bottom: none;
}

.notifications-index__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 24px;
  gap: 8px;
}
.notifications-index__empty-icon {
  color: #3d4947;
  opacity: 0.28;
}
.notifications-index__empty-title {
  font-size: 14px;
  font-weight: 600;
  color: #191c1e;
  margin: 0;
}
.notifications-index__empty-body {
  font-size: 12px;
  color: #565e74;
  margin: 0;
  text-align: center;
}

/* ============================================
   NOTIFICATION TOAST (transient pop-up)
   Dark surface + colored left rail per priority,
   matches the prototype-2 design language.
   ============================================ */
#notifications-toast-region {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 600;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 360px;
  width: calc(100vw - 48px);
}

.notif-toast {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: #191c1e;
  color: #ffffff;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.20);
  pointer-events: auto;
  overflow: hidden;
  transform: translateY(12px) scale(0.96);
  opacity: 0;
  transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 240ms ease;
}
.notif-toast.is-visible {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.notif-toast.is-leaving {
  transform: translateY(8px) scale(0.96);
  opacity: 0;
}

.notif-toast--priority-urgent { border-left: 4px solid #dc2626; }
.notif-toast--priority-normal { border-left: 4px solid #d97706; }
.notif-toast--priority-info   { border-left: 4px solid #00685f; }

.notif-toast__icon {
  flex-shrink: 0;
  margin-top: 1px;
  line-height: 1;
}
.notif-toast__icon--urgent { color: #fc8181; }
.notif-toast__icon--normal { color: #fbbf24; }
.notif-toast__icon--info   { color: #5eead4; }

.notif-toast__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.notif-toast__title {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1.3;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.notif-toast__sub {
  font-size: 11px;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color: rgba(255, 255, 255, 0.70);
  margin: 0;
}

.notif-toast__dismiss {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.60);
  transition: background 110ms ease, color 110ms ease;
}
.notif-toast__dismiss:hover {
  background: rgba(255, 255, 255, 0.10);
  color: #ffffff;
}

/* Bottom progress bar — animated countdown to auto-dismiss. */
@keyframes notif-toast-progress {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}
.notif-toast__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  transform-origin: left center;
  background: rgba(255, 255, 255, 0.35);
  animation: notif-toast-progress var(--toast-duration, 6000ms) linear forwards;
}
.notif-toast.is-paused .notif-toast__progress {
  animation-play-state: paused;
}

/* Mobile (≤640px): toast pinned bottom, full-width minus margins */
@media (max-width: 640px) {
  #notifications-toast-region {
    bottom: 16px;
    right: 16px;
    left: 16px;
    max-width: none;
    width: auto;
  }
}

/* Per-row read/unread toggle.
   Desktop (>1024px): hover-reveal, 32x32.
   Tablet (641-1024px): always visible at 0.55 opacity, 36x36.
   Mobile (≤640px): always visible at 0.65 opacity, 40x40 (touch target). */
.notification-row__toggle-form {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
}
.notification-row__toggle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #3d4947;
  opacity: 0;
  transition: opacity 110ms ease, background 110ms ease, color 110ms ease;
}
.notification-row:hover .notification-row__toggle,
.notification-row:focus-visible .notification-row__toggle {
  opacity: 0.85;
}
.notification-row__toggle:hover {
  background: rgba(0, 0, 0, 0.06);
  opacity: 1 !important;
  color: #00685f;
}
.notification-row__toggle:focus-visible {
  opacity: 1;
  outline: 2px solid #00685f;
  outline-offset: 2px;
}
@media (max-width: 1024px) {
  .notification-row__toggle {
    width: 36px;
    height: 36px;
    opacity: 0.55;
  }
  .notification-row__content { padding-right: 56px; }
}
@media (max-width: 640px) {
  .notification-row__toggle {
    width: 40px;
    height: 40px;
    opacity: 0.65;
  }
  .notification-row__toggle-form { right: 6px; }
  .notification-row__content {
    padding: 14px 60px 14px 14px;
  }
  .notification-row { min-height: 64px; }
}

/* ============================================
   ZOHO SUPPORT WIDGET — mobile overlay hide
   ============================================
   On phones the Zoho SalesIQ float button overlaps modal/drawer footers
   (Save buttons, etc.), so we hide it whenever an overlay surface is
   open: any drawer (`body.drawer-open`, set by drawer_controller), the
   notifications drawer (`body.notifications-drawer-locked`), or a modal
   currently rendered into `#modal-container`. Desktop keeps the widget
   visible — there's enough room for it not to conflict. */
@media (max-width: 767px) {
  body.drawer-open .zsiq_theme1,
  body.drawer-open #zsiq_chat_wrap,
  body.notifications-drawer-locked .zsiq_theme1,
  body.notifications-drawer-locked #zsiq_chat_wrap,
  body:has(#modal-container > *) .zsiq_theme1,
  body:has(#modal-container > *) #zsiq_chat_wrap {
    visibility: hidden !important;
  }
}
