/* ================================================================
   17_notifications.css
   Notifications, saved views modal
   ================================================================ */

/* ===========================
   NAVBAR NOTIFICATIONS (bell)
   ===========================
   Recommended structure:

   <button class="nav-link nav-icon-btn" ...>
     <span class="nav-icon-stack">
       <i class="bi bi-bell"></i>
       <span class="nav-notif-badge">2</span>   // or: <span class="nav-notif-dot"></span>
     </span>
   </button>
*/

/* make sure absolute children always have a positioning context */
.nav-icon-btn{
  position: relative;
}

/* 24×24 icon box so the badge anchors to the icon (not the 60px-tall navbar) */
.nav-icon-stack{
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.nav-icon-stack > .bi{
  line-height: 1;
  font-size: 1.15rem;
}

/* numeric count bubble (overlaps the bell nicely) */
.nav-notif-badge{
  position: absolute;
  top: 0;
  right: 0;

  /* push it out of the icon box a bit (this is what fixes the “looks off”) */
  transform: translate(45%, -45%);

  height: 16px;
  min-width: 16px;
  padding: 0 5px;
  border-radius: 999px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.2px;
  font-variant-numeric: tabular-nums;

  color: rgba(255,255,255,.98);

  background-color: rgba(59,130,246,.95);
  background-image: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,0));

  /* ring that matches the navbar + soft elevation */
  box-shadow:
    0 0 0 2px var(--nav-bg, #07263f),
    0 6px 16px rgba(0,0,0,.22);

  pointer-events: none;
}



/* ===========================
   NOTIFICATIONS OFFCANVAS
   =========================== */

/* Notifications Offcanvas (dark glass) */
.notifications-offcanvas.offcanvas{
  background: linear-gradient(180deg, rgba(10, 40, 68, .95) 0%, rgba(7, 28, 48, .98) 100%);
  color: rgba(255,255,255,.92);
  border-left: 1px solid rgba(255,255,255,.08);
  box-shadow: -24px 0 50px rgba(0,0,0,.35);
  backdrop-filter: blur(10px);
}

.notifications-offcanvas .offcanvas-header{
  padding: 1rem 1rem .85rem;
  border-bottom: 1px solid rgba(255,255,255,.10);
  background: linear-gradient(180deg, rgba(255,255,255,.05) 0%, rgba(255,255,255,0) 100%);
}

.notifications-offcanvas .offcanvas-title{
  color: rgba(255,255,255,.95);
  letter-spacing: .2px;
}

/* Make Bootstrap “muted” readable on dark */
.notifications-offcanvas .text-muted{
  color: rgba(255,255,255,.62) !important;
}

.notifications-offcanvas .btn-close{
  filter: invert(1);
  opacity: .65;
}
.notifications-offcanvas .btn-close:hover{ opacity: .95; }

.notifications-offcanvas .offcanvas-body{
  padding: .85rem 1rem 1rem;
}

.notifications-offcanvas hr{
  border-color: rgba(255,255,255,.10) !important;
  opacity: 1;
}

/* Buttons inside the drawer */
.notifications-offcanvas .btn-ghost{
  color: rgba(255,255,255,.92);
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: .65rem;
  padding: .42rem .65rem;
  font-weight: 600;
  transition: transform .12s ease, background .16s ease, border-color .16s ease;
}
.notifications-offcanvas .btn-ghost:hover{
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.22);
  transform: translateY(-1px);
}
.notifications-offcanvas .btn-ghost:active{
  transform: translateY(0);
  background: rgba(255,255,255,.10);
}

/* List layout */
.notifications-offcanvas .notif-list{
  display: flex;
  flex-direction: column;
  gap: .55rem;
}

/* Card-like items */
.notifications-offcanvas .notif-list .list-group-item{
  margin: 0;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: .85rem !important;
  padding: .85rem .85rem;
  color: rgba(255,255,255,.92);
  text-decoration: none;
  box-shadow: 0 10px 22px rgba(0,0,0,.16);
  transition: transform .14s ease, background .14s ease, box-shadow .14s ease, border-color .14s ease;
}

.notifications-offcanvas .notif-list .list-group-item:hover{
  background: rgba(255,255,255,.08);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(0,0,0,.22);
}

.notifications-offcanvas .notif-list .list-group-item:focus{
  outline: none;
  box-shadow: 0 0 0 3px rgba(255,255,255,.14), 0 14px 28px rgba(0,0,0,.22);
}

/* Unread state */
.notifications-offcanvas .notif-item.is-unread{
  background: rgba(13,110,253,.14);
  border-color: rgba(13,110,253,.30);
}
.notifications-offcanvas .notif-item.is-unread:hover{
  background: rgba(13,110,253,.18);
}

/* LEFT dot in the list (not positioned like a navbar badge) */
.notifications-offcanvas .notif-dot{
  position: static;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin: .35rem .65rem 0 .1rem;
  flex: 0 0 auto;

  background: rgba(255,255,255,.18);
  border: 2px solid var(--nav-bg, #07263f);
}

.notifications-offcanvas .notif-dot[data-unread="1"]{
  background: #0d6efd;
}

/* Text styles */
.notifications-offcanvas .notif-title{
  font-weight: 650;
  font-size: .95rem;
  line-height: 1.2;
}

.notifications-offcanvas .notif-time{
  color: rgba(255,255,255,.68);
  font-size: .78rem;
  white-space: nowrap;
}

.notifications-offcanvas .notif-meta{
  color: rgba(255,255,255,.70);
  font-size: .82rem;
}

.notifications-offcanvas .notif-delta{
  margin-left: auto;
  font-size: .82rem;
  font-weight: 700;
  padding: .12rem .5rem;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.92);
}

.notifications-offcanvas .notif-delta.is-up{
  background: rgba(25, 135, 84, .22);
}

.notifications-offcanvas .notif-delta.is-down{
  background: rgba(220, 53, 69, .22);
}

/* Empty state on dark */
.notifications-offcanvas .notif-empty{
  border: 1px dashed rgba(255,255,255,.18);
  border-radius: .85rem;
  padding: 1rem;
  text-align: center;
  margin-top: .5rem;
  background: rgba(255,255,255,.04);
}
.notifications-offcanvas .notif-empty__icon{
  font-size: 1.6rem;
  margin-bottom: .25rem;
  color: rgba(255,255,255,.70);
}

/* Natural action links */
.notifications-offcanvas .notif-actions{
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:.25rem;
  margin: .15rem 0 .65rem;
}

.notifications-offcanvas .notif-actionlink{
  display:inline-flex;
  align-items:center;
  gap:.45rem;

  padding: .34rem .55rem;
  border-radius: .65rem;

  background: transparent;
  border: 1px solid transparent;

  color: rgba(255,255,255,.78);
  font-weight: 650;
  font-size: .86rem;
  text-decoration: none;

  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .12s ease;
}

.notifications-offcanvas .notif-actionlink .bi{
  font-size: .95rem;
  opacity: .9;
}

.notifications-offcanvas .notif-actionlink:hover{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.10);
  color: rgba(255,255,255,.95);
  transform: translateY(-1px);
}

.notifications-offcanvas .notif-actionlink:active{
  transform: translateY(0);
  background: rgba(255,255,255,.08);
}

.notifications-offcanvas .notif-actionlink:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px rgba(255,255,255,.14);
}

/* ── Saved Views Modal (was: views_modal.css) ────────────────── */
/* ==========================================================================
   Price Intelligence – Saved Views Modal (Modern Dark)
   ========================================================================== */

/* Wrapper ----------------------------------------------------------------- */
.pi-views-modal .modal-dialog {
  max-width: min(520px, 96vw);
  margin: 4vh auto;
}

.pi-views-modal .modal-content {
  /* Flatter, more neutral surface */
  background: var(--surface-glass, rgba(8, 12, 22, 0.98));
  -webkit-backdrop-filter: blur(18px) saturate(115%);
  backdrop-filter: blur(18px) saturate(115%);
  color: var(--text-strong);
  border-radius: 12px;
  border: 1px solid var(--border-glass);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

/* Fallback when blur not supported */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .pi-views-modal .modal-content {
    background: #0b1220;
  }
}

/* Header ------------------------------------------------------------------ */
.pi-views-modal .modal-header {
  border-bottom: 1px solid var(--divider-glass);
  padding: 0.6rem 0.9rem;
}

.pi-views-modal .modal-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.2px;
}

.pi-views-modal .btn-close {
  filter: invert(1) opacity(0.75);
}
.pi-views-modal .btn-close:hover {
  opacity: 1;
}

/* Body layout ------------------------------------------------------------- */
.pi-views-modal .modal-body {
  padding: 1rem 0.95rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Sections – no more glass cards ----------------------------------------- */
.pi-views-modal .form-section {
  background: transparent;
  border-radius: 0;
  border: none;
  padding: 0.25rem 0 0.9rem;
}

/* Section headings */
.pi-views-modal h6 {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.2px;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

/* Inputs – flatter, quieter ---------------------------------------------- */
/* Use both class-based AND ID-based selectors for maximum specificity */
.pi-views-modal .form-control,
.pi-views-modal .input-select,
[id$="-view-name-input"] {
  background-color: rgba(255, 255, 255, 0.03) !important;
  color: var(--text-strong) !important;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: none !important;
}

.pi-views-modal .form-control::placeholder,
[id$="-view-name-input"]::placeholder {
  color: var(--text-muted) !important;
}

.pi-views-modal .form-control:focus,
[id$="-view-name-input"]:focus {
  outline: none;
  box-shadow: var(--focus-ring) !important;
  border-color: rgba(72, 168, 255, 0.65) !important;
  background-color: rgba(255, 255, 255, 0.05) !important;
}

/* Dash dcc.Dropdown — force dark theme on every React-Select sub-element.
   ID-based selectors guarantee priority over the generic .input-select
   rules defined in 16_pharmacies.css. */
[id$="-views-dropdown"] .Select-control,
[id$="-views-dropdown"] .Select__control,
[id$="-views-dropdown"] [class*="-control"],
.pi-views-modal .dash-dropdown .Select-control,
.pi-views-modal .dash-dropdown .Select__control,
.pi-views-modal .dash-dropdown [class*="-control"] {
  background: rgba(255,255,255,0.05) !important;
  background-color: rgba(255,255,255,0.05) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  box-shadow: none !important;
  color: var(--text-strong, rgba(255,255,255,.88)) !important;
}

/* Wrappers — transparent so no white leaks through */
[id$="-views-dropdown"] .Select,
[id$="-views-dropdown"] .Select--single,
[id$="-views-dropdown"] .dash-dropdown {
  background: transparent !important;
  background-color: transparent !important;
}

/* Selected-value chip (16_pharmacies sets #eef2f7 on .Select-value) */
[id$="-views-dropdown"] .Select-value,
[id$="-views-dropdown"] .Select__single-value,
.pi-views-modal .dash-dropdown .Select-value {
  background: transparent !important;
  background-color: transparent !important;
  border-color: transparent !important;
  color: var(--text-strong, rgba(255,255,255,.88)) !important;
}

/* Text elements: placeholder, value label, input */
[id$="-views-dropdown"] .Select-placeholder,
[id$="-views-dropdown"] .Select-value-label,
[id$="-views-dropdown"] .Select__single-value,
[id$="-views-dropdown"] .Select__placeholder,
[id$="-views-dropdown"] [class*="-singleValue"],
[id$="-views-dropdown"] [class*="-placeholder"],
[id$="-views-dropdown"] .Select-input input,
.pi-views-modal .dash-dropdown .Select-placeholder,
.pi-views-modal .dash-dropdown .Select-value-label {
  color: var(--text-strong, rgba(255,255,255,.88)) !important;
}

[id$="-views-dropdown"] .Select-menu-outer,
[id$="-views-dropdown"] .Select__menu,
[id$="-views-dropdown"] [class*="-menu"]:not([class*="-menuList"]),
.pi-views-modal .dash-dropdown .Select-menu-outer,
.pi-views-modal .dash-dropdown .Select__menu {
  background-color: rgba(7, 12, 21, 0.98) !important;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.6);
}
.pi-views-modal .Select-option,
.pi-views-modal .Select__option,
.pi-views-modal [class*="-option"] {
  color: var(--text-strong, rgba(255,255,255,.88)) !important;
  background-color: transparent !important;
}
.pi-views-modal .Select-option.is-focused,
.pi-views-modal .Select__option--is-focused {
  background: rgba(255,255,255,0.08) !important;
}
.pi-views-modal .Select-option.is-selected,
.pi-views-modal .Select__option--is-selected {
  background: rgba(255,255,255,0.14) !important;
}
.pi-views-modal .Select-arrow-zone,
.pi-views-modal .Select__indicator,
.pi-views-modal .Select__dropdown-indicator,
[id$="-views-dropdown"] .Select-arrow-zone,
[id$="-views-dropdown"] [class*="-indicatorContainer"],
[id$="-views-dropdown"] [class*="-indicator"] {
  color: rgba(255,255,255,.5) !important;
}
[id$="-views-dropdown"] .Select-arrow {
  border-top-color: rgba(255,255,255,.5) !important;
}

/* Small helper text */
.pi-views-modal small.text-muted {
  color: var(--text-muted) !important;
}

/* Text cascade — force light text on all common elements */
.pi-views-modal .modal-body,
.pi-views-modal label,
.pi-views-modal p,
.pi-views-modal span,
.pi-views-modal small,
.pi-views-modal h6,
.pi-views-modal .form-label,
.pi-views-modal .form-check-label {
  color: var(--text-strong, rgba(255,255,255,.92)) !important;
}

/* Switch / checklist ----------------------------------------------------- */
.pi-views-modal .form-check.form-switch .form-check-input {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: none;
}
.pi-views-modal .form-check.form-switch .form-check-input:checked {
  background-color: var(--brand-accent);
  border-color: var(--brand-accent);
}

/* Footer ----------------------------------------------------------------- */
.pi-views-modal .modal-footer {
  border-top: 1px solid var(--divider-glass);
  background: transparent;        /* let the modal gradient show through */
  padding: 0.7rem 0.9rem;
}

/* Buttons – clearer hierarchy -------------------------------------------- */
.pi-views-modal .btn-primary {
  background-color: var(--brand-accent);
  border-color: var(--brand-accent);
  color: #fff;
  font-weight: 600;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}
.pi-views-modal .btn-primary:hover {
  filter: brightness(1.03);
}
.pi-views-modal .btn-primary:active {
  filter: brightness(0.97);
}
.pi-views-modal .btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Secondary actions – ghost style */
.pi-views-modal .btn-secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-strong, rgba(255,255,255,.88));
}
.pi-views-modal .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}

.pi-views-modal .btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Saved views – gentle delete button ------------------------------------ */
.pi-views-modal .btn-delete-view {
  border-color: transparent;
  color: #ff7a45;                    /* brighter on dark glass */
  background: transparent;
}

.pi-views-modal .btn-delete-view:hover,
.pi-views-modal .btn-delete-view:focus {
  background-color: rgba(255, 122, 69, 0.12);
  border-color: rgba(255, 122, 69, 0.30);
  color: #ff9466;
}

/* -------------------------------
   Metric toggle: text-like links
   ------------------------------- */


/* Override for solid navy dropdown menu (later in cascade = wins) */
[id$="-views-dropdown"] .Select-menu-outer,
[id$="-views-dropdown"] .Select__menu,
[id$="-views-dropdown"] [class*="-menu"]:not([class*="-menuList"]),
.pi-views-modal .dash-dropdown .Select-menu-outer,
.pi-views-modal .dash-dropdown .Select__menu {
  background-color: #16264f !important;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.6);
}

/* Saved views select should feel clickable */
[id$="-views-dropdown"],
[id$="-views-dropdown"] .Select-control,
[id$="-views-dropdown"] [class*="-control"] {
  cursor: pointer;
}

.pi-views-modal .btn-outline-primary {
  background: transparent;
  border-color: var(--brand-accent);
  color: var(--brand-accent);
  font-weight: 600;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.pi-views-modal .btn-outline-primary:hover {
  background: rgba(72, 168, 255, 0.08);
}

/* Inline action icons (Load / Delete) next to dropdown ------------------- */
.pi-views-modal .views-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.55);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.10);
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  flex-shrink: 0;
  text-decoration: none;
  font-size: 0.92rem;
}
.pi-views-modal .views-action-icon:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
  text-decoration: none;
}
.pi-views-modal .views-action-delete:hover {
  color: #ff7a45;
  background: rgba(255, 122, 69, 0.10);
  border-color: rgba(255, 122, 69, 0.25);
}

/* Reset link (footer, left-aligned) -------------------------------------- */
.pi-views-modal .views-reset-link {
  color: rgba(255, 255, 255, 0.50) !important;
  text-decoration: none;
  font-size: 0.82rem;
  padding: 0;
}
.pi-views-modal .views-reset-link:hover {
  color: rgba(255, 255, 255, 0.85) !important;
  text-decoration: underline;
}

/* Body divider ----------------------------------------------------------- */
.pi-views-modal hr {
  border-color: var(--divider-glass, rgba(255, 255, 255, 0.10));
  opacity: 1;
}

/* ==========================================================================
   Saved Views – Quick-switch Popover
   ========================================================================== */

.views-picker-popover {
  --vp-bg: var(--surface-glass, rgba(8, 12, 22, 0.98));
  --vp-border: rgba(255, 255, 255, 0.12);
  --vp-hover: rgba(255, 255, 255, 0.06);
  --vp-active: rgba(72, 168, 255, 0.10);
  --vp-text: var(--text-strong, rgba(255, 255, 255, 0.92));
  --vp-muted: var(--text-muted, rgba(255, 255, 255, 0.50));
  --vp-accent: var(--brand-accent, #48a8ff);

  min-width: 220px;
  max-width: 320px;
  border: 1px solid var(--vp-border);
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  background: var(--vp-bg);
  -webkit-backdrop-filter: blur(18px) saturate(115%);
  backdrop-filter: blur(18px) saturate(115%);
  padding: 0;
  overflow: hidden;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .views-picker-popover { background: #0b1220; }
}

.views-picker-popover .popover-body { padding: 0; }

/* Hide the default Bootstrap arrow — doesn't match our glass aesthetic */
.views-picker-popover .popover-arrow { display: none; }

/* ── Individual list items ─────────────────────────────────────────── */
.views-picker-item {
  display: flex;
  align-items: center;
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  color: var(--vp-text);
  cursor: pointer;
  transition: background-color 0.12s ease;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  user-select: none;
}

.views-picker-item:hover {
  background: var(--vp-hover);
}

.views-picker-item.active {
  background: var(--vp-active);
  font-weight: 600;
}

.views-picker-item .bi-star-fill {
  color: var(--vp-accent);
  font-size: 0.72rem;
}

.views-picker-item .bi-file-earmark {
  color: var(--vp-muted);
  font-size: 0.72rem;
}

.views-picker-item .bi-check2 {
  color: var(--vp-accent);
}

/* ── "Manage views…" row ───────────────────────────────────────────── */
.views-picker-manage {
  color: var(--vp-muted);
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem;
}

.views-picker-manage:hover {
  color: var(--vp-text);
  background: var(--vp-hover);
}

/* ── Separator inside the popover ──────────────────────────────────── */
.views-picker-popover hr {
  border-color: var(--vp-border);
  opacity: 1;
  margin: 0;
}

/* Force light text inside popover (overrides Bootstrap text-muted dark default) */
.views-picker-popover .text-muted {
  color: var(--vp-muted) !important;
}
