/* The notification inbox design shared by the customer app and the staff app (public/js/notification-design.js), from
   "my notes/samdart-notifications-design.html". Everything is prefixed nt- so it cannot touch the rest of the app. */

.nt-page, .nt-sheet, .nt-toast, .nt-pop {
  --nt-deep: #073d31; --nt-forest: #123f31; --nt-green: #087957; --nt-mint: #e3f1ea; --nt-amber: #8a5410; --nt-amber-bg: #fdf1dc;
  --nt-cream: #f6f3ea; --nt-line: #e4e8e3; --nt-ink: #16211c; --nt-muted: #5f6b65; --nt-blue: #1f4e8c; --nt-blue-bg: #e8eff9; --nt-red: #b3261e;
  --nt-card: #fff; --nt-unread: #f7fbf8;
}
html[data-scheme="dark"] .nt-page, html[data-scheme="dark"] .nt-sheet, html[data-scheme="dark"] .nt-toast, html[data-scheme="dark"] .nt-pop {
  --nt-deep: #66d6a8; --nt-forest: #cfe9dd; --nt-green: #66d6a8; --nt-mint: #1d3a2f; --nt-amber: #f0c46b; --nt-amber-bg: #3a3017;
  --nt-cream: #202a25; --nt-line: #2c3731; --nt-ink: #eee9dc; --nt-muted: #9eb0a7; --nt-blue: #9cc0f0; --nt-blue-bg: #1c2a40; --nt-red: #ef7a72;
  --nt-card: #18201c; --nt-unread: #1b2620;
}

.nt-page, .nt-sheet, .nt-toast, .nt-pop { font-family: var(--font-ui, inherit); }
.nt-page button, .nt-page input, .nt-sheet button, .nt-toast button, .nt-pop button { font-family: inherit; }
.nt-page { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; width: 100%; max-width: 46rem; margin: 0 auto; color: var(--nt-ink); }
.nt-page > * { min-width: 0; }

/* The Read / Unread tabs (the app's own tab style) sit at the top. */
.nt-page > .customer-notifications-status-tabs { margin-bottom: 0.7rem; }

/* The categories, with the three-dot menu at their right end. */
.nt-filters { display: flex; align-items: flex-start; gap: 0.5rem; }
.nt-filters > #customer-notifications-chips, .nt-filters > #admin-notifications-chips { flex: 1; min-width: 0; }
.nt-filters > details { flex: none; }

/* Not used on the customer page any more; the staff screen still shows the count line. */
.nt-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; min-height: 2.75rem; }
.nt-count { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--nt-muted); font-size: 0.9rem; font-weight: 700; }
.nt-count em { display: grid; place-items: center; min-width: 1.5rem; height: 1.5rem; padding: 0 0.45rem; border-radius: 12px; background: var(--nt-red); color: #fff; font-size: 0.8rem; font-style: normal; font-weight: 800; }
.nt-mark { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 2.75rem; padding: 0 0.25rem; border: 0; background: none; color: var(--nt-green); font-size: 0.9rem; font-weight: 700; cursor: pointer; }
.nt-mark[disabled] { color: #9aa39e; cursor: default; }
html[data-scheme="dark"] .nt-mark[disabled] { color: #62706a; }

/* The search bar with the three-dot menu at its right. */
.nt-tools { display: flex; align-items: center; gap: 0.5rem; padding-bottom: 0.7rem; }
.nt-search { display: flex; flex: 1; align-items: center; gap: 0.5rem; min-width: 0; min-height: 2.75rem; padding: 0 0.85rem; border: 1px solid var(--nt-line); border-radius: 14px; background: var(--nt-card); color: var(--nt-muted); }
.nt-search svg { flex: none; }
.nt-search input { flex: 1; width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--nt-ink); font-size: 14px; }
.nt-search:focus-within { border-color: var(--nt-green); box-shadow: 0 0 0 3px rgb(8 121 87 / 18%); }
.nt-tools > details { flex: none; }
.nt-chips { display: flex; gap: 0.5rem; padding: 0.15rem 0 0.8rem; overflow-x: auto; scrollbar-width: none; }
.nt-chips::-webkit-scrollbar { display: none; }
.nt-chip { display: flex; flex: none; align-items: center; gap: 0.4rem; min-height: 2.5rem; padding: 0 0.75rem; border: 1px solid var(--nt-line); border-radius: 999px; background: var(--nt-card); color: var(--nt-muted); font-size: 14px; font-weight: 600; cursor: pointer; }
.nt-chip em { display: grid; place-items: center; min-width: 1.15rem; height: 1.15rem; padding: 0 0.3rem; border-radius: 9px; background: var(--nt-red); color: #fff; font-size: 0.72rem; font-style: normal; }
.nt-chip.is-on { border-color: var(--nt-deep); background: var(--nt-deep); color: #fff; }
html[data-scheme="dark"] .nt-chip.is-on { color: #0d1713; }

.nt-list { padding: 0; }
.nt-day { margin: 0.9rem 0.25rem 0.5rem; color: var(--nt-muted); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.nt-card { overflow: hidden; border: 1px solid var(--nt-line); border-radius: 18px; background: var(--nt-card); }
.nt-item { position: relative; overflow: hidden; border-bottom: 1px solid var(--nt-line); background: var(--nt-red); }
.nt-item:last-child { border-bottom: 0; }
.nt-del { position: absolute; top: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.25rem; width: 5.5rem; border: 0; background: none; color: #fff; font-size: 0.78rem; font-weight: 700; cursor: pointer; }
.nt-row { position: relative; display: flex; gap: 0.75rem; width: 100%; padding: 0.9rem; background: var(--nt-card); text-align: left; cursor: pointer; transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.2s; touch-action: pan-y; }
.nt-row.is-unread { background: var(--nt-unread); }
.nt-row.is-drag { transition: none; }
.nt-row.is-selected { box-shadow: inset 3px 0 0 var(--nt-green); }
.nt-row:focus-visible { outline: 3px solid rgb(8 121 87 / 30%); outline-offset: -3px; }
.nt-ico { position: relative; display: grid; flex: none; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 14px; }
.nt-ico.is-update { background: var(--nt-amber-bg); color: var(--nt-amber); }
.nt-ico.is-pay { background: var(--nt-mint); color: var(--nt-deep); }
.nt-ico.is-order { background: var(--nt-blue-bg); color: var(--nt-blue); }
.nt-ico.is-alert { background: #fde8e6; color: var(--nt-red); }
html[data-scheme="dark"] .nt-ico.is-alert { background: #3d1f1d; }
.nt-ico.has-photo { background: var(--nt-card); }
.nt-ico img { display: block; width: 100%; height: 100%; border-radius: 14px; object-fit: cover; }
.nt-dot { position: absolute; top: -3px; left: -3px; width: 0.75rem; height: 0.75rem; border: 2px solid var(--nt-card); border-radius: 50%; background: var(--nt-green); }
.nt-txt { flex: 1; min-width: 0; }
.nt-eb { margin-bottom: 0.1rem; color: var(--nt-muted); font-size: 12px; font-weight: 500; }
.nt-eb .nt-k { font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.nt-hd b { font-size: 15px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.nt-row.is-unread .nt-hd b { font-weight: 800; }
.nt-pv { display: -webkit-box; margin-top: 0.1rem; overflow: hidden; color: var(--nt-muted); font-size: 14px; font-weight: 400; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; }
.nt-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }
.nt-amt { padding: 0.2rem 0.55rem; border-radius: 8px; background: var(--nt-mint); color: var(--nt-deep); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
/* The link: a button of its own (it goes straight where it says); the rest of the row opens the notification. */
.nt-act { display: inline-flex; align-items: center; gap: 0.1rem; min-height: 2rem; padding: 0.15rem 0.35rem; margin-left: -0.35rem; border: 0; border-radius: 8px; background: none; color: var(--nt-green); font-size: 13px; font-weight: 700; cursor: pointer; }
.nt-act:focus-visible { background: rgb(8 121 87 / 10%); }
@media (hover: hover) { .nt-act:hover { background: rgb(8 121 87 / 10%); } }
.nt-act:focus-visible { outline: 2px solid var(--nt-green); outline-offset: 1px; }

.nt-empty { padding: 3.5rem 1.5rem; color: var(--nt-muted); text-align: center; }
.nt-empty .nt-big { display: grid; place-items: center; width: 4.5rem; height: 4.5rem; margin: 0 auto 0.9rem; border-radius: 50%; background: var(--nt-mint); color: var(--nt-deep); }
.nt-empty b { display: block; margin-bottom: 0.25rem; color: var(--nt-ink); font-size: 17px; font-weight: 700; }
.nt-end { margin: 1.4rem 0 0.25rem; color: var(--nt-muted); font-size: 13px; text-align: center; }

/* The sheet for one notification */
dialog.nt-sheet { position: fixed; inset: auto 0 0 0; z-index: 90; display: flex; flex-direction: column; width: 100%; max-width: 28rem; max-height: 86vh; margin: 0 auto; padding: 0; border: 0; border-radius: 24px 24px 0 0; background: var(--nt-card); color: var(--nt-ink); box-shadow: 0 -10px 40px rgb(10 30 20 / 25%); }
dialog.nt-sheet::backdrop { background: rgb(10 24 18 / 45%); }
@media (prefers-reduced-motion: no-preference) {
  dialog.nt-sheet[open] { animation: nt-sheet-up 0.38s cubic-bezier(0.22, 1, 0.36, 1); }
  @keyframes nt-sheet-up { from { transform: translateY(100%); } to { transform: none; } }
  .nt-toast { transition: opacity 0.25s, transform 0.25s; }
}
dialog.nt-sheet.is-drag { transition: none; animation: none; }
body.nt-sheet-open { overflow: hidden; }
.nt-grab { display: flex; justify-content: center; padding: 0.65rem 0 0.25rem; cursor: grab; touch-action: none; }
.nt-grab i { width: 2.75rem; height: 5px; border-radius: 3px; background: #cfd5cf; }
.nt-sbody { overflow: auto; padding: 0.5rem 1.25rem; }
.nt-shead { display: flex; align-items: center; gap: 0.75rem; }
.nt-t b { display: block; font-size: 18px; font-weight: 700; line-height: 1.25; }
.nt-t span { color: var(--nt-muted); font-size: 13px; }
.nt-tag { display: inline-block; margin-bottom: 0.25rem; padding: 0.1rem 0.5rem; border-radius: 6px; font-size: 0.69rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.nt-tag.is-update { background: var(--nt-amber-bg); color: var(--nt-amber); }
.nt-tag.is-pay { background: var(--nt-mint); color: var(--nt-deep); }
.nt-tag.is-order { background: var(--nt-blue-bg); color: var(--nt-blue); }
.nt-msg { margin: 1rem 0 0.25rem; color: var(--nt-ink); font-size: 15px; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.nt-tile { display: flex; align-items: center; justify-content: space-between; margin-top: 0.9rem; padding: 0.9rem 1rem; border-radius: 14px; background: var(--nt-cream); }
.nt-tile span { color: var(--nt-muted); font-size: 0.82rem; font-weight: 600; }
.nt-tile b { color: var(--nt-deep); font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.nt-sfoot { display: flex; gap: 0.6rem; margin-top: 0.6rem; padding: 0.75rem 1.25rem calc(0.9rem + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--nt-line); }
.nt-sfoot button { min-height: 3.1rem; border: 0; border-radius: 14px; font-size: 15px; font-weight: 700; cursor: pointer; }
.nt-primary { flex: 1; background: var(--nt-deep); color: #fff; }
html[data-scheme="dark"] .nt-primary { color: #0d1713; }
.nt-trash { display: grid; place-items: center; width: 3.4rem; background: #fbe7e5; color: var(--nt-red); }
html[data-scheme="dark"] .nt-trash { background: #3a1f1d; }

.nt-toast { position: fixed; left: 50%; bottom: 6rem; z-index: 120; display: flex; align-items: center; gap: 0.9rem; max-width: 92vw; padding: 0.6rem 0.75rem 0.6rem 1rem; border-radius: 12px; background: #16211c; color: #fff; font-size: 14px; opacity: 0; transform: translate(-50%, 20px); pointer-events: none; }
.nt-toast.is-on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.nt-toast button { min-height: 2rem; padding: 0 0.4rem; border: 0; background: none; color: #9ee0c3; font: inherit; font-weight: 800; cursor: pointer; }

/* On the staff screen the list sits at the left, under the page title. */
#admin-notifications-page { max-width: 52rem; margin: 0; }

/* The bell's pop-up: the latest notifications, a tinted row for each unread one, and a link to all of them. */
body:not(.page-admin) .nt-pop { position: absolute; z-index: 40; top: calc(100% + 0.65rem); right: 0; display: flex; flex-direction: column; width: min(24rem, calc(100vw - 2rem)); max-height: min(75vh, 34rem); overflow: hidden; border: 1px solid var(--nt-line); border-radius: 20px; background: var(--nt-card); color: var(--nt-ink); box-shadow: 0 18px 48px rgb(10 32 23 / 28%); }
body:not(.page-admin) .nt-pop[hidden] { display: none; }
.nt-pop-head { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 1rem 1.1rem 0.9rem; }
.nt-pop-head h2 { display: flex; align-items: center; gap: 0.55rem; margin: 0; color: var(--nt-ink); font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.nt-pop-count { display: grid; place-items: center; min-width: 1.5rem; height: 1.5rem; padding: 0 0.4rem; border-radius: 999px; background: var(--nt-red); color: #fff; font-size: 13px; font-weight: 800; line-height: 1; }
.nt-pop-count[hidden] { display: none; }
.nt-pop-mark { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 2.5rem; padding: 0 0.2rem; border: 0; background: none; color: var(--nt-green); font-size: 15px; font-weight: 700; cursor: pointer; }
.nt-pop-mark:disabled { color: var(--nt-muted); cursor: default; opacity: 0.55; }
.nt-pop-mark:focus-visible, .nt-pop-foot:focus-visible, .nt-pop-row:focus-visible { outline: 2px solid var(--nt-green); outline-offset: -2px; }
.nt-pop .customer-notifications-status { margin: 0; padding: 0 1.1rem; }
.nt-pop .customer-notifications-status:empty { display: none; }
.nt-pop-list { flex: 1; min-height: 0; overflow-y: auto; border-top: 1px solid var(--nt-line); }
.nt-pop-row { display: flex; align-items: flex-start; gap: 0.8rem; width: 100%; padding: 0.9rem 1.1rem; border: 0; border-bottom: 1px solid var(--nt-line); background: var(--nt-card); color: var(--nt-ink); text-align: left; cursor: pointer; }
.nt-pop-row.is-unread { background: #eef7f1; }
html[data-scheme="dark"] .nt-pop-row.is-unread { background: #1b2a22; }
@media (hover: hover) { .nt-pop-row:hover { background: var(--nt-cream); } }
.nt-pop-row .nt-ico { width: 2.5rem; height: 2.5rem; }
.nt-pop-body { flex: 1; min-width: 0; }
.nt-pop-top { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; }
.nt-pop-top b { min-width: 0; color: var(--nt-ink); font-size: 15px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.nt-pop-row.is-unread .nt-pop-top b { font-weight: 800; }
.nt-pop-when { display: inline-flex; flex: none; align-items: center; gap: 0.5rem; color: var(--nt-muted); font-size: 14px; white-space: nowrap; }
.nt-pop-when i { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--nt-green); }
.nt-pop-pv { display: -webkit-box; margin-top: 0.15rem; overflow: hidden; color: var(--nt-muted); font-size: 14px; line-height: 1.45; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nt-pop-empty { display: grid; justify-items: center; gap: 0.35rem; padding: 1.8rem 1.2rem; text-align: center; }
.nt-pop-empty .nt-ico { width: 3.4rem; height: 3.4rem; border-radius: 50%; background: var(--nt-mint); color: var(--nt-deep); }
.nt-pop-empty b { margin-top: 0.4rem; color: var(--nt-ink); font-size: 17px; font-weight: 700; }
.nt-pop-empty span { color: var(--nt-muted); font-size: 14px; }
.nt-pop-foot { display: flex; flex: none; align-items: center; justify-content: center; gap: 0.4rem; width: 100%; min-height: 3.4rem; border: 0; border-top: 1px solid var(--nt-line); background: var(--nt-cream); color: var(--nt-green); font-size: 16px; font-weight: 700; cursor: pointer; }
@media (max-width: 680px) {
  body:not(.page-admin) .nt-pop { position: fixed; top: calc(env(safe-area-inset-top) + 4.3rem); right: max(0.5rem, env(safe-area-inset-right)); width: min(24rem, calc(100vw - 1rem)); max-height: calc(100dvh - 5rem - env(safe-area-inset-top)); }
}

/* The bell in the Operations Admin opens the same panel as the customer app (header with the unread count and Mark all read, rows, footer to the full list). */
.alert-pop.nt-pop { display: flex; flex-direction: column; width: min(24rem, calc(100vw - 1.5rem)); max-height: min(72vh, 34rem); padding: 0; overflow: hidden; border: 1px solid var(--nt-line); border-radius: 22px; background: var(--nt-card); box-shadow: 0 18px 44px rgb(14 38 27 / 20%); }
.alert-pop.nt-pop[hidden] { display: none; }
.alert-pop.nt-pop .nt-pop-row { display: flex; width: 100%; padding: 0.9rem 1.1rem; border-radius: 0; background: var(--nt-card); text-align: left; }
.alert-pop.nt-pop .nt-pop-row.is-unread { background: #eef7f1; }
@media (hover: hover) { .alert-pop.nt-pop .nt-pop-row:hover { background: var(--nt-cream); } }
.alert-pop.nt-pop .nt-pop-mark { display: inline-flex; width: auto; padding: 0 0.2rem; border-radius: 0; background: none; }
@media (hover: hover) { .alert-pop.nt-pop .nt-pop-mark:hover { background: none; } }
.alert-pop.nt-pop .nt-pop-foot { display: flex; width: 100%; padding: 0; border-radius: 0; background: var(--nt-cream); }
.alert-pop.nt-pop .nt-pop-push { flex: none; width: 100%; padding: 0.7rem 1.1rem; border: 0; border-top: 1px solid var(--nt-line); border-radius: 0; background: var(--nt-card); color: var(--nt-green); font-size: 0.86rem; font-weight: 700; text-align: left; }
.alert-pop.nt-pop .staff-push-status { margin: 0; padding: 0 1.1rem 0.8rem; color: var(--nt-muted); font-size: 0.76rem; }
html[data-scheme="dark"] .alert-pop.nt-pop .nt-pop-row.is-unread { background: #1b2a22; }
