/* ==========================================================================
   CareMetrix — Notifications (Organization)
   Master list of notification types, each linked to a module + menu.
   Same headrow / collapsible-filters / searchrow-with-pagination shell as
   Calendar/Events and Notice Board, so the three "list" pages feel like one
   product. Built from shared components (.commonstyletabletwo, .pagination,
   .drawer, .overlay, .field, .badge) — only the bits those don't already
   cover live here.
   ========================================================================== */

.ntf { --ntf-pink: #D0479A; --ntf-pink-soft: #FBEAF4; }

.ntf-pagepath { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }

.ntf-card { padding: 22px 24px 26px; }

.ntf-headrow { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.ntf-headrow__title { display: flex; align-items: center; gap: 14px; }
.ntf-headrow__icon {
  width: 44px; height: 44px; border-radius: 12px; background: var(--violet-bg); color: var(--brand-purple);
  display: grid; place-items: center; flex: none;
}
.ntf-headrow__icon svg { width: 20px; height: 20px; }
.ntf-headrow__title h1 { font-size: 19px; font-weight: 700; margin: 0; }
.ntf-headrow__title p { font-size: 12.5px; color: var(--text-2); margin: 3px 0 0; }
.ntf-headrow__actions { display: flex; align-items: center; gap: 10px; }

.ntf-filterbtn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 16px;
  border: 1.5px solid var(--ntf-pink); border-radius: var(--r-btn);
  background: var(--surface); color: var(--ntf-pink);
  font-size: 13px; font-weight: 700; flex: none; transition: all .14s var(--ease);
}
.ntf-filterbtn:hover { background: var(--ntf-pink-soft); }
.ntf-filterbtn svg { width: 16px; height: 16px; }
.ntf-filterbtn.is-open { background: var(--ntf-pink-soft); }

.ntf-filters { padding: 16px 18px; margin: -4px 0 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); }
.ntf-filters[hidden] { display: none; }
.ntf-filters__row { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.ntf-filter { display: flex; flex-direction: column; gap: 6px; flex: 1 1 0; min-width: 170px; }
.ntf-filter__label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.ntf-filters__actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; margin-left: auto; }

.ntf-searchrow { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.ntf-search { position: relative; flex: 1; min-width: 240px; max-width: 420px; }
.ntf-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); }
.ntf-search input { width: 100%; height: 40px; padding: 0 14px 0 40px; border: 1.5px solid var(--border); border-radius: var(--r-btn); background: var(--surface); font-size: 13px; color: var(--text); }
.ntf-search input:focus { outline: none; border-color: var(--form-focus); box-shadow: 0 0 0 3px var(--form-focus-ring); }
.ntf-searchrow__pagination { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.ntf-searchrow__perpage { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.ntf-searchrow__perpage select { border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 12.5px; background: var(--surface); color: var(--text); }

.ntf-fd__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.ntf-fd__grid .field { margin-bottom: 0; }

.ntf-type-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 6px; flex: none; }
.ntf-type-dot--email    { background: var(--blue); }
.ntf-type-dot--sms      { background: var(--violet); }
.ntf-type-dot--push     { background: var(--amber); }
.ntf-type-dot--whatsapp { background: var(--green); }

.ntf-channels__empty { font-size: 12px; color: var(--text-3); font-style: italic; }

/* ---- list: content-type ticks ---- */
.ntf-ctypes { display: grid; grid-template-columns: repeat(2, auto); gap: 6px 16px; }
.ntf-ctypes__item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.ntf-ctypes__icon { width: 15px; height: 15px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; }
.ntf-ctypes__icon svg { width: 9px; height: 9px; }
.ntf-ctypes__icon--yes { background: var(--green-bg); color: var(--green); }
.ntf-ctypes__icon--no { background: var(--red-bg); color: var(--red); }

/* ---- row action menu ---- */
.ntf-morebtn { width: 32px; height: 32px; border-radius: 9px; border: none; background: transparent; color: var(--text-3); display: inline-grid; place-items: center; cursor: pointer; transition: all .16s var(--ease); }
.ntf-morebtn svg { width: 18px; height: 18px; }
.ntf-morebtn:hover, .ntf-morebtn[aria-expanded="true"] { background: var(--violet-bg); color: var(--brand-purple); }

.ntf-rowmenu { position: fixed; z-index: 120; min-width: 170px; padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); display: none; }
.ntf-rowmenu.is-open { display: block; }
.ntf-rowmenu__item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--text-2); text-align: left; transition: background .16s var(--ease); }
.ntf-rowmenu__item svg { width: 16px; height: 16px; flex: none; }
.ntf-rowmenu__item--view:hover { background: var(--violet-bg); color: var(--brand-purple); }
.ntf-rowmenu__item--edit:hover { background: var(--amber-bg); color: var(--amber); }
.ntf-rowmenu__item--status:hover { background: var(--green-bg); color: var(--green); }
.ntf-rowmenu__item--danger { color: var(--red); }
.ntf-rowmenu__item--danger:hover { background: var(--red-bg); }

/* ---- add/edit: one compact card per channel ---- */
.ntf-channel { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; background: var(--surface-2); }
.ntf-channel .field { margin-bottom: 12px; }
.ntf-channel .field:last-child { margin-bottom: 0; }
.ntf-channel__head { display: flex; align-items: center; font-size: 12.5px; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 12px; }
.ntf-channel__name { flex: 1 1 auto; }
/* The switch only controls whether this channel sends — its fields stay
   fully editable either way, so the "off" state is just a muted label,
   never a disabled/greyed-out look on the inputs themselves. */
.ntf-channel.is-disabled .ntf-channel__name { color: var(--text-3); }

/* ---- per-channel enable/disable switch (CareMetrix standard toggle,
   same skeleton as .ros-toggle/.crl-switch — checked = brand gradient) ---- */
.ntf-switch { position: relative; display: inline-flex; flex: none; width: 38px; height: 21px; cursor: pointer; }
.ntf-switch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.ntf-switch__track { position: absolute; inset: 0; background: var(--border-strong); border-radius: 999px; transition: background .18s var(--ease); }
.ntf-switch__track::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  transition: transform .18s var(--ease);
}
.ntf-switch input:checked + .ntf-switch__track { background: var(--grad-brand); }
.ntf-switch input:checked + .ntf-switch__track::after { transform: translateX(17px); }
.ntf-switch input:focus-visible + .ntf-switch__track { box-shadow: 0 0 0 3px var(--violet-bg); }

/* ---- Direct Send Yes/No segmented radio ---- */
.ntf-yn { display: inline-flex; border: 1.5px solid var(--border-strong); border-radius: var(--r-btn); overflow: hidden; width: fit-content; }
.ntf-yn__opt { position: relative; display: flex; align-items: center; padding: 6px 18px; font-size: 12.5px; font-weight: 600; color: var(--text-2); cursor: pointer; transition: background .15s var(--ease), color .15s var(--ease); }
.ntf-yn__opt + .ntf-yn__opt { border-left: 1.5px solid var(--border-strong); }
.ntf-yn__opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.ntf-yn__opt:has(input:checked) { background: var(--grad-brand); color: #fff; }
.ntf-yn__opt:has(input:focus-visible) { box-shadow: inset 0 0 0 2px var(--violet-bg); }

.ntf .field__hint { display: block; font-size: 11px; color: var(--text-3); margin-top: 4px; }

/* ---- lightweight functional rich-text editor ---- */
.ntf-richedit { border: 1.5px solid var(--border-strong); border-radius: var(--r-btn); overflow: hidden; background: var(--surface); }
.ntf-richedit__toolbar { display: flex; align-items: center; gap: 4px; padding: 6px 8px; background: var(--surface-3); border-bottom: 1px solid var(--border); }
.ntf-richedit__toolbar button {
  width: 26px; height: 26px; border-radius: 6px; border: none; background: transparent;
  color: var(--text-2); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .14s var(--ease);
}
.ntf-richedit__toolbar button:hover { background: var(--violet-bg); color: var(--brand-purple); }
.ntf-richedit__area { min-height: 90px; padding: 10px 12px; font-size: 13px; color: var(--text); line-height: 1.5; outline: none; overflow-y: auto; }
.ntf-richedit__area:empty::before { content: attr(data-placeholder); color: var(--text-3); pointer-events: none; }
.ntf-richedit__area ul, .ntf-richedit__area ol { padding-left: 20px; margin: 6px 0; }

.ntf-whom { font-size: 13px; font-weight: 600; color: var(--text); }
.ntf-when { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

.ntf-view-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.ntf-view-label { font-size: 10.5px; font-weight: 700; color: var(--brand-purple); text-transform: uppercase; letter-spacing: .04em; }
.ntf-view-value { font-size: 13.5px; font-weight: 500; color: var(--text); margin-top: 3px; }
.ntf-view-notes { font-size: 12.5px; color: var(--text-2); line-height: 1.55; margin-top: 8px; }
.ntf-view-section {
  font-size: 11.5px; font-weight: 600; color: var(--brand-purple);
  text-transform: uppercase; letter-spacing: .05em;
  margin: 22px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.ntf-view-section:first-child { margin-top: 0; }

.ntf-view-channels { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.ntf-view-channel { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; background: var(--surface-2); }
.ntf-view-channel__head { display: flex; align-items: center; font-size: 11.5px; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 10px; }
.ntf-view-channel__subject { font-size: 13.5px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.ntf-view-channel__content { font-size: 12.5px; color: var(--text-2); line-height: 1.55; }
.ntf-view-channel__content ul, .ntf-view-channel__content ol { padding-left: 20px; margin: 6px 0; }
.ntf-view-channel__empty { font-size: 12px; color: var(--text-3); font-style: italic; }

@media (max-width: 900px) {
  .ntf-fd__grid { grid-template-columns: 1fr; }
  .ntf-view-grid { grid-template-columns: 1fr; }
  .ntf-headrow, .ntf-searchrow { flex-direction: column; align-items: stretch; }
  .ntf-filters__row { flex-direction: column; align-items: stretch; }
  .ntf-filters__actions { margin-left: 0; }
}
