/*
 * Notification Manager admin styles (local only — no CDN).
 *
 * Light ops-admin surface that sits inside the WHMCS admin chrome.
 * Accent: teal. Avoid purple gradients and dark-mode takeover.
 */

@font-face {
    font-family: "IRANSans";
    src: url("../fonts/IRANSans/IRANSansWeb.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "IRANSans";
    src: url("../fonts/IRANSans/IRANSansWeb_Medium.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "IRANSans";
    src: url("../fonts/IRANSans/IRANSansWeb_Bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

.notification-manager {
    --nm-bg: #f1f5f9;
    --nm-surface: #ffffff;
    --nm-surface-2: #f8fafc;
    --nm-border: #e2e8f0;
    --nm-border-strong: #cbd5e1;
    --nm-text: #0f172a;
    --nm-muted: #64748b;
    --nm-accent: #0f766e;
    --nm-accent-soft: #ccfbf1;
    --nm-accent-hover: #0d9488;
    --nm-success: #15803d;
    --nm-success-soft: #dcfce7;
    --nm-warn: #b45309;
    --nm-warn-soft: #ffedd5;
    --nm-danger: #b91c1c;
    --nm-danger-soft: #fee2e2;
    --nm-radius: 12px;
    --nm-radius-sm: 8px;
    --nm-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.04);
    --nm-focus: 0 0 0 3px rgba(13, 148, 136, 0.28);
    --nm-transition: 160ms ease;
    --nm-font-latin: "Segoe UI", system-ui, -apple-system, sans-serif;
    --nm-font-persian: "IRANSans", "Tahoma", "Segoe UI", sans-serif;

    margin: 0 0 24px;
    color: var(--nm-text);
    font-family: var(--nm-font-latin);
    font-size: 16px;
    line-height: 1.65;
}

.notification-manager[dir="rtl"],
.notification-manager[data-nm-locale="persian"] {
    font-family: var(--nm-font-persian);
    font-size: 16.5px;
    line-height: 1.75;
    text-align: right;
}

.notification-manager[dir="ltr"],
.notification-manager[data-nm-locale="english"] {
    font-family: var(--nm-font-latin);
    text-align: left;
}

.notification-manager *,
.notification-manager *::before,
.notification-manager *::after {
    box-sizing: border-box;
}

/* Mixed Persian/English: keep identifiers stable, prose readable */
.notification-manager .nm-bidi-isolate {
    unicode-bidi: isolate;
}

.notification-manager .nm-bidi-plaintext {
    unicode-bidi: plaintext;
}

.notification-manager .nm-message-summary[dir="rtl"],
.notification-manager .nm-message-full[dir="rtl"],
.notification-manager .nm-inbox-item__body[dir="rtl"],
.notification-manager .nm-message-body [dir="rtl"] {
    text-align: right;
}

.notification-manager .nm-message-summary[dir="ltr"],
.notification-manager .nm-message-full[dir="ltr"],
.notification-manager .nm-inbox-item__body[dir="ltr"],
.notification-manager .nm-message-body [dir="ltr"] {
    text-align: left;
}

.notification-manager code,
.notification-manager .nm-bidi-isolate[dir="ltr"] {
    direction: ltr;
    unicode-bidi: isolate;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.92em;
}

.notification-manager a {
    color: var(--nm-accent);
    text-decoration: none;
    cursor: pointer;
    transition: color var(--nm-transition);
}

.notification-manager a:hover {
    color: var(--nm-accent-hover);
}

.notification-manager a:focus-visible,
.notification-manager button:focus-visible,
.notification-manager .nm-nav__link:focus-visible,
.notification-manager .form-control:focus {
    outline: none;
    box-shadow: var(--nm-focus);
}

/* —— Shell / header —— */
.notification-manager .nm-shell {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.notification-manager .nm-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px 20px;
    padding: 16px 18px;
    background: linear-gradient(135deg, #ffffff 0%, #f0fdfa 55%, #f8fafc 100%);
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius);
    box-shadow: var(--nm-shadow);
}

.notification-manager .nm-header__title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--nm-text);
}

.notification-manager .nm-header__sub {
    margin: 4px 0 0;
    color: var(--nm-muted);
    font-size: 1rem;
}

.notification-manager .nm-header__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* —— Nav tabs —— */
.notification-manager .nm-nav {
    margin: 0;
    padding: 6px;
    background: var(--nm-surface);
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius);
    box-shadow: var(--nm-shadow);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.notification-manager .nm-nav__list {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
    min-width: min-content;
}

.notification-manager .nm-nav__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 15px;
    border-radius: var(--nm-radius-sm);
    color: var(--nm-muted);
    font-weight: 600;
    font-size: 0.98rem;
    white-space: nowrap;
    border: 1px solid transparent;
    background: transparent;
    transition: background var(--nm-transition), color var(--nm-transition), border-color var(--nm-transition);
    cursor: pointer;
    text-decoration: none;
}

.notification-manager .nm-nav__link:hover {
    color: var(--nm-text);
    background: var(--nm-surface-2);
    border-color: var(--nm-border);
}

.notification-manager .nm-nav__link.is-active {
    color: var(--nm-accent);
    background: var(--nm-accent-soft);
    border-color: #99f6e4;
}

.notification-manager .nm-nav__icon {
    display: inline-flex;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    opacity: 0.85;
}

.notification-manager .nm-nav__icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* —— Cards / sections —— */
.notification-manager .nm-card {
    background: var(--nm-surface);
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius);
    box-shadow: var(--nm-shadow);
    padding: 18px 20px;
}

.notification-manager .nm-card + .nm-card {
    margin-top: 16px;
}

.notification-manager .nm-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 14px;
}

.notification-manager .nm-card__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.notification-manager .nm-card__help {
    margin: 0 0 14px;
    color: var(--nm-muted);
    font-size: 0.9rem;
}

.notification-manager .nm-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* —— Status grid —— */
.notification-manager .nm-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.notification-manager .nm-metric {
    padding: 14px 16px;
    background: var(--nm-surface-2);
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius-sm);
}

.notification-manager .nm-metric__label {
    display: block;
    margin-bottom: 6px;
    color: var(--nm-muted);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.notification-manager .nm-metric__value.is-loading {
    opacity: 0.45;
}

.notification-manager .nm-metric__value {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--nm-text);
    word-break: break-word;
}

.notification-manager a.nm-metric--link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.notification-manager a.nm-metric--link:hover,
.notification-manager a.nm-metric--link:focus {
    border-color: var(--nm-accent, #2563eb);
    outline: none;
}

.notification-manager .nm-metric__hint {
    display: block;
    margin-top: 6px;
    color: var(--nm-muted);
    font-size: 0.78rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.35;
}

.notification-manager .nm-dash__kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.notification-manager .nm-dash .nm-metric {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 100%;
}

.notification-manager .nm-metric__icon {
    display: inline-flex;
    color: var(--nm-muted);
    margin-bottom: 2px;
}

.notification-manager .nm-metric__state {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--nm-muted);
}

.notification-manager .nm-metric--ok {
    border-color: var(--nm-success);
    background: var(--nm-success-soft);
}

.notification-manager .nm-metric--ok .nm-metric__icon,
.notification-manager .nm-metric--ok .nm-metric__state {
    color: var(--nm-success);
}

.notification-manager .nm-metric--warn {
    border-color: var(--nm-warn);
    background: var(--nm-warn-soft);
}

.notification-manager .nm-metric--warn .nm-metric__icon,
.notification-manager .nm-metric--warn .nm-metric__state {
    color: var(--nm-warn);
}

.notification-manager .nm-metric--danger {
    border-color: var(--nm-danger);
    background: var(--nm-danger-soft);
}

.notification-manager .nm-metric--danger .nm-metric__icon,
.notification-manager .nm-metric--danger .nm-metric__state {
    color: var(--nm-danger);
}

.notification-manager .nm-dash__charts,
.notification-manager .nm-dash__meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.notification-manager .nm-dash__panel {
    padding: 14px 16px;
    background: var(--nm-surface-2);
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius-sm);
}

.notification-manager .nm-dash__panel-title {
    margin: 0 0 10px;
    font-size: 0.9rem;
    font-weight: 700;
}

.notification-manager .nm-dash__spark {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notification-manager .nm-spark {
    display: block;
    max-width: 100%;
}

.notification-manager .nm-dash__legend {
    margin: 8px 0 0;
    font-size: 0.78rem;
    color: var(--nm-muted);
}

.notification-manager .nm-dash__swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    margin-inline-end: 4px;
    vertical-align: -1px;
}

.notification-manager .nm-dash__swatch--sends {
    background: var(--nm-accent);
}

.notification-manager .nm-dash__swatch--calls {
    background: var(--nm-warn);
}

.notification-manager .nm-dash__channels {
    list-style: none;
    margin: 0;
    padding: 0;
}

.notification-manager .nm-dash__channels li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 0;
    border-bottom: 1px solid var(--nm-border);
}

.notification-manager .nm-dash__stale {
    color: var(--nm-danger);
    font-weight: 600;
}

@media (max-width: 640px) {
    .notification-manager .nm-dash__kpis,
    .notification-manager .nm-dash__charts,
    .notification-manager .nm-dash__meta {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .notification-manager .nm-metric,
    .notification-manager .nm-dash__panel {
        transition: none;
    }
}

.notification-manager .nm-messenger-clients-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-bottom: 1rem;
}

.notification-manager .nm-messenger-clients-filters label {
    margin: 0;
    font-weight: 600;
}

@media (max-width: 640px) {
    .notification-manager .nm-messenger-clients-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

.notification-manager .nm-dl {
    display: grid;
    grid-template-columns: minmax(140px, 220px) 1fr;
    gap: 0;
    margin: 0;
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius-sm);
    overflow: hidden;
}

.notification-manager .nm-dl > div {
    display: contents;
}

.notification-manager .nm-dl dt,
.notification-manager .nm-dl dd {
    margin: 0;
    padding: 12px 14px;
    border-bottom: 1px solid var(--nm-border);
}

.notification-manager .nm-dl dt {
    background: var(--nm-surface-2);
    color: var(--nm-muted);
    font-weight: 600;
    font-size: 0.88rem;
}

.notification-manager .nm-dl dd {
    background: var(--nm-surface);
    color: var(--nm-text);
}

.notification-manager .nm-dl > div:last-child dt,
.notification-manager .nm-dl > div:last-child dd {
    border-bottom: 0;
}

/* —— Badges —— */
.notification-manager .nm-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
    vertical-align: middle;
}

.notification-manager .nm-badge--ok {
    color: var(--nm-success);
    background: var(--nm-success-soft);
}

.notification-manager .nm-badge--warn {
    color: var(--nm-warn);
    background: var(--nm-warn-soft);
}

.notification-manager .nm-badge--danger {
    color: var(--nm-danger);
    background: var(--nm-danger-soft);
}

.notification-manager .nm-badge--muted {
    color: var(--nm-muted);
    background: #e2e8f0;
}

.notification-manager .nm-badge--accent {
    color: var(--nm-accent);
    background: var(--nm-accent-soft);
}

.notification-manager .nm-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex: 0 0 auto;
}

/* —— Forms —— */
.notification-manager .nm-field {
    display: grid;
    grid-template-columns: minmax(120px, 200px) 1fr;
    gap: 10px 16px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--nm-border);
}

.notification-manager .nm-field:last-of-type {
    border-bottom: 0;
}

.notification-manager .nm-field label {
    margin: 0;
    font-weight: 600;
    color: var(--nm-text);
}

.notification-manager .form-control,
.notification-manager input.form-control,
.notification-manager select.form-control,
.notification-manager textarea.form-control {
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--nm-border-strong);
    border-radius: var(--nm-radius-sm);
    background: #fff;
    color: var(--nm-text);
    box-shadow: none;
    transition: border-color var(--nm-transition), box-shadow var(--nm-transition);
}

.notification-manager .form-control:hover {
    border-color: #94a3b8;
}

.notification-manager .btn,
.notification-manager button.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 8px 16px;
    border-radius: var(--nm-radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background var(--nm-transition), border-color var(--nm-transition), color var(--nm-transition), box-shadow var(--nm-transition);
}

.notification-manager .btn-primary {
    background: var(--nm-accent);
    border-color: var(--nm-accent);
    color: #fff;
}

.notification-manager .btn-primary:hover,
.notification-manager .btn-primary:focus {
    background: var(--nm-accent-hover);
    border-color: var(--nm-accent-hover);
    color: #fff;
}

.notification-manager .btn-default {
    background: #fff;
    border: 1px solid var(--nm-border-strong);
    color: var(--nm-text);
}

.notification-manager .btn-default:hover {
    background: var(--nm-surface-2);
    border-color: #94a3b8;
}

.notification-manager .nm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.notification-manager .nm-actions form {
    display: inline;
    margin: 0;
}

.notification-manager .alert {
    border-radius: var(--nm-radius-sm);
    border: 1px solid transparent;
}

.notification-manager .alert-success {
    background: var(--nm-success-soft);
    border-color: #bbf7d0;
    color: var(--nm-success);
}

.notification-manager .alert-danger {
    background: var(--nm-danger-soft);
    border-color: #fecaca;
    color: var(--nm-danger);
}

.notification-manager .alert-warning {
    background: var(--nm-warn-soft);
    border-color: #fed7aa;
    color: var(--nm-warn);
}

/* —— Tables —— */
.notification-manager table.table {
    width: 100%;
    table-layout: auto;
    margin: 0;
    background: var(--nm-surface);
    border: 1px solid var(--nm-border) !important;
    border-radius: var(--nm-radius-sm);
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
}

.notification-manager table.table > thead > tr > th,
.notification-manager table.table > tbody > tr > th,
.notification-manager table.table > tbody > tr > td {
    padding: 11px 14px;
    border-top: 0;
    border-bottom: 1px solid var(--nm-border);
    vertical-align: middle;
}

.notification-manager table.table > thead > tr > th {
    background: var(--nm-surface-2);
    color: var(--nm-muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.notification-manager table.table > tbody > tr:last-child > td,
.notification-manager table.table > tbody > tr:last-child > th {
    border-bottom: 0;
}

.notification-manager table.table-striped > tbody > tr:nth-of-type(odd) {
    background: #fcfdff;
}

.notification-manager td,
.notification-manager th {
    word-break: break-word;
}

.notification-manager .nm-status-ok td:nth-child(4) {
    color: var(--nm-success);
    font-weight: 600;
}

.notification-manager .nm-status-fail td:nth-child(4),
.notification-manager .nm-status-danger td:nth-child(5),
.notification-manager .nm-status-danger td:nth-child(6) {
    color: var(--nm-danger, #b91c1c);
    font-weight: 600;
}

.notification-manager .nm-messages-table tbody tr.nm-status-danger,
.notification-manager .nm-messages-table tbody tr.nm-row-failed {
    background: #fdeceb;
}

.notification-manager .nm-messages-table tbody tr.nm-status-danger:hover,
.notification-manager .nm-messages-table tbody tr.nm-row-failed:hover {
    background: #fad2cf;
}

.notification-manager .nm-messages-table tbody tr.nm-row-failed td {
    border-color: #f0c2be;
}

.notification-manager .nm-fail-label {
    display: inline-block;
    margin-top: 4px;
    font-weight: 600;
}

.notification-manager .nm-fail-detail {
    margin-top: 6px;
}

.notification-manager .nm-fail-detail pre {
    max-height: 12rem;
    overflow: auto;
    margin: 6px 0 0;
    white-space: pre-wrap;
    font-size: 11px;
}

.notification-manager .nm-flash-pre {
    white-space: pre-wrap;
    word-break: break-word;
}

.notification-manager .nm-col-actions .nm-inline-form {
    display: inline-block;
    margin: 0 4px 4px 0;
}

.notification-manager .nm-filter-form {
    margin-bottom: 16px;
}

.notification-manager .nm-filter-bar {
    display: grid;
    grid-template-columns: minmax(11rem, 1.4fr) repeat(3, minmax(8.5rem, 1fr)) minmax(14rem, 1.6fr) auto;
    gap: 10px 12px;
    align-items: end;
    margin-bottom: 14px;
}

.notification-manager .nm-filter-bar__select .nm-sublabel {
    display: block;
    margin: 0 0 4px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--nm-muted);
}

.notification-manager .nm-filter-bar__dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.notification-manager .nm-filter-date-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    align-items: stretch;
}

.notification-manager .nm-filter-bar input.form-control,
.notification-manager .nm-filter-bar select.form-control {
    height: 40px;
    min-height: 40px;
    max-height: 40px;
    box-sizing: border-box;
    padding-top: 8px;
    padding-bottom: 8px;
    line-height: 1.25;
}

.notification-manager .nm-filter-bar input[type="date"].form-control {
    /* Safari/Chrome date chrome otherwise taller than text/select */
    -webkit-appearance: none;
    appearance: none;
}

.notification-manager .nm-filter-bar__actions {
    display: flex;
    align-items: center;
}

.notification-manager .nm-delivery-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
    margin: 0 0 16px;
}

.notification-manager .nm-panel-cell {
    line-height: 1.35;
    min-width: 9rem;
}

.notification-manager .nm-panel-meta {
    color: var(--nm-muted);
    font-size: 0.92rem;
}

.notification-manager .nm-badge--origin {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--nm-surface-2);
    border: 1px solid var(--nm-border);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--nm-text);
}

.notification-manager .nm-messages-table {
    font-size: 1.02rem;
}

.notification-manager .nm-col-time {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.notification-manager .nm-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 1100px) {
    .notification-manager .nm-filter-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .notification-manager .nm-filter-bar__dates,
    .notification-manager .nm-filter-bar__actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .notification-manager .nm-filter-bar {
        grid-template-columns: 1fr;
    }

    .notification-manager .nm-filter-bar__dates {
        grid-template-columns: 1fr;
    }

    .notification-manager .nm-filter-date-pair {
        grid-template-columns: 1fr 1fr;
    }
}

.notification-manager .nm-pagination {
    margin: 12px 0;
}

.notification-manager .nm-report-actions {
    margin-top: 16px;
}

.notification-manager .nm-panel-form .form-group {
    margin-bottom: 14px;
}

.notification-manager .nm-test-result {
    margin-top: 12px;
    max-width: 100%;
    overflow: auto;
    white-space: pre-wrap;
    padding: 12px;
    background: var(--nm-surface-2);
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius-sm);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
}

.notification-manager .nm-muted {
    color: var(--nm-muted);
}

.notification-manager .nm-muted-inline {
    color: var(--nm-muted);
    font-size: 0.95rem;
    margin-inline-start: 8px;
}

.notification-manager .nm-note {
    margin: 12px 0 0;
    color: var(--nm-muted);
    font-size: 0.95rem;
}

.notification-manager .nm-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.notification-manager .nm-locale-chips,
.notification-manager .nm-locale-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.notification-manager .nm-locale-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--nm-surface-2);
    border: 1px solid var(--nm-border);
    font-size: 0.88rem;
    font-weight: 600;
}

.notification-manager .nm-locale-actions .btn {
    min-height: 36px;
    padding: 6px 12px;
    font-size: 0.92rem;
}

.notification-manager .nm-locale-actions--bar {
    margin-bottom: 14px;
}

.notification-manager .nm-locale-tab {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: var(--nm-radius-sm);
    border: 1px solid var(--nm-border);
    background: var(--nm-surface-2);
    color: var(--nm-muted);
    font-weight: 600;
}

.notification-manager .nm-locale-tab.is-active {
    background: var(--nm-accent-soft);
    border-color: #99f6e4;
    color: var(--nm-accent);
}

.notification-manager textarea.nm-bidi-plaintext {
    font-size: 1rem;
    line-height: 1.7;
    min-height: 180px;
}

.notification-manager[dir="rtl"] .nm-nav__list {
    flex-direction: row;
}

.notification-manager-preferences .nm-pref-form {
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius);
    background: var(--nm-surface);
}

.notification-manager-preferences .nm-phone-block {
    margin-bottom: 28px;
    padding-bottom: 8px;
}

.notification-manager-preferences .nm-phone-block + h3,
.notification-manager-preferences h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.notification-manager-preferences .nm-extra-phone-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.notification-manager-preferences .nm-extra-phone-row .intl-tel-input,
.notification-manager-preferences .nm-extra-phone-input {
    flex: 1 1 220px;
    max-width: 28rem;
    min-width: 180px;
}

.notification-manager-preferences .nm-extra-phone-save {
    flex: 0 0 auto;
    margin-inline-start: 0;
}

.notification-manager-preferences .nm-extra-phone-delete {
    margin-top: 10px;
}

.notification-manager-preferences .nm-bind-sync-banner {
    margin-bottom: 16px;
}

.notification-manager-preferences .nm-chat-bindings {
    list-style: none;
    margin: 0.75rem 0 1.25rem;
    padding: 0;
}

.notification-manager-preferences h3 + .text-muted {
    margin-bottom: 12px;
}

.notification-manager-preferences .nm-chat-binding {
    margin-bottom: 12px;
    padding: 12px 14px;
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius);
    background: var(--nm-surface);
    line-height: 1.5;
}

.notification-manager-preferences .nm-chat-binding--bound {
    border-color: #16a34a;
    background: #f0fdf4;
}

.notification-manager-preferences .nm-chat-binding--bound .nm-chat-binding__status {
    color: #15803d;
}

.notification-manager-preferences .nm-chat-unbind-form {
    display: inline-block;
    margin-inline-start: 8px;
    vertical-align: middle;
}

.notification-manager-preferences .nm-chat-binding--pending {
    border-color: #f59e0b;
    background: #fffbeb;
}

.notification-manager-preferences .nm-chat-binding code {
    word-break: break-all;
}

.notification-manager-preferences fieldset label {
    display: inline-block;
    margin-inline-end: 12px;
}

@media (max-width: 768px) {
    .notification-manager .nm-header {
        padding: 14px;
    }

    .notification-manager .nm-card {
        padding: 14px;
    }

    .notification-manager .nm-dl {
        grid-template-columns: 1fr;
    }

    .notification-manager .nm-dl dt {
        border-bottom: 0;
        padding-bottom: 2px;
    }

    .notification-manager .nm-dl dd {
        padding-top: 2px;
    }

    .notification-manager .nm-field {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .notification-manager table.table,
    .notification-manager table.table tbody,
    .notification-manager table.table tr,
    .notification-manager table.table td,
    .notification-manager table.table th {
        display: block;
        width: auto;
    }

    .notification-manager table.table thead {
        display: none;
    }

    .notification-manager table.table > tbody > tr {
        padding: 10px 0;
        border-bottom: 1px solid var(--nm-border);
    }

    .notification-manager .nm-actions form {
        display: block;
        margin: 4px 0;
    }

    .notification-manager .form-inline .form-control {
        display: block;
        width: 100%;
        margin-bottom: 8px;
    }
}

/* Checkbox + label gap (LTR and RTL) */
.notification-manager .nm-check-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    align-items: center;
}

.notification-manager .nm-check {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0;
    font-weight: 500;
    cursor: pointer;
    line-height: 1.4;
}

.notification-manager .nm-check input {
    margin: 0;
    flex: 0 0 auto;
    width: 1.05em;
    height: 1.05em;
}

.notification-manager .nm-check span {
    display: inline-block;
    padding-inline-start: 0;
}

/* Live client search */
.notification-manager .nm-user-search {
    position: relative;
}

.notification-manager .nm-user-results {
    position: absolute;
    z-index: 40;
    left: 0;
    right: 0;
    top: calc(100% + 2px);
    max-width: 36rem;
    max-height: 240px;
    overflow: auto;
    background: var(--nm-surface);
    border: 1px solid var(--nm-border-strong);
    border-radius: var(--nm-radius-sm);
    box-shadow: var(--nm-shadow);
}

.notification-manager .nm-user-results:not([hidden]) {
    display: block;
}

.notification-manager[dir="rtl"] .nm-user-results {
    text-align: right;
}

.notification-manager .nm-user-results__item {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid var(--nm-border);
    background: transparent;
    text-align: inherit;
    color: var(--nm-text);
    cursor: pointer;
}

.notification-manager .nm-user-results__item:hover,
.notification-manager .nm-user-results__item:focus {
    background: var(--nm-accent-soft);
    outline: none;
}

.notification-manager .nm-help {
    margin: 6px 0 0;
    color: var(--nm-muted);
    font-size: 0.9em;
}

.notification-manager .nm-message-body {
    white-space: pre-wrap;
    word-break: break-word;
    max-width: 28rem;
    font-family: var(--nm-font-persian), var(--nm-font-latin);
}

.notification-manager .nm-message-open {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--nm-accent);
    text-align: inherit;
    cursor: pointer;
    white-space: normal;
    word-break: break-word;
    line-height: 1.45;
    font: inherit;
}

.notification-manager .nm-message-open:hover,
.notification-manager .nm-message-open:focus-visible {
    text-decoration: underline;
    color: var(--nm-accent-hover);
}

.notification-manager .nm-message-dialog {
    position: fixed;
    inset: 0;
    margin: auto;
    width: min(40rem, 94vw);
    max-height: min(80vh, 40rem);
    padding: 0;
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
    background: var(--nm-surface);
    color: var(--nm-text);
}

.notification-manager .nm-message-dialog::backdrop {
    background: rgba(15, 23, 42, 0.45);
}

.notification-manager .nm-message-dialog__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--nm-border);
}

.notification-manager .nm-message-dialog__title {
    margin: 0;
    font-size: 1.05rem;
}

.notification-manager .nm-message-dialog__body {
    margin: 0;
    padding: 14px 16px 18px;
    max-height: min(60vh, 28rem);
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.55;
}

.notification-manager .nm-sender-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.notification-manager .nm-sender-row .form-control,
.notification-manager .nm-sender-row select {
    flex: 1 1 220px;
}

.notification-manager .nm-inbox-list {
    margin-top: 12px;
    max-height: 280px;
    overflow: auto;
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius-sm);
}

.notification-manager .nm-check-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
}

.notification-manager .nm-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.notification-manager .nm-lang-block {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--nm-border);
}

.notification-manager .nm-card--nested {
    margin: 12px 0 16px;
    padding: 14px 16px;
    background: var(--nm-surface-2);
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius-sm);
}

.notification-manager .nm-section-title {
    margin: 18px 0 10px;
    font-size: 1.05rem;
}

.notification-manager .nm-template-name {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.notification-manager .nm-template-name__en {
    color: var(--nm-muted, #667);
    font-size: 0.92rem;
}

.notification-manager .nm-locale-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.notification-manager .nm-locale-chip {
    display: inline-block;
    padding: 2px 8px;
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius-sm);
    background: var(--nm-surface);
    font-size: 0.85rem;
}

.notification-manager .nm-inbox-item {
    display: block;
    width: 100%;
    text-align: inherit;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid var(--nm-border);
    background: transparent;
    cursor: pointer;
}

.notification-manager .nm-inbox-item:hover {
    background: var(--nm-accent-soft);
}

.notification-manager .nm-panel-live__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.notification-manager .nm-panel-live__text {
    font-weight: 600;
}

.notification-manager .nm-status-ok {
    color: #1b7a3d;
}

.notification-manager .nm-status-bad {
    color: #a11;
}

.notification-manager .nm-templates-section {
    margin: 0 0 14px;
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius);
    background: var(--nm-surface);
    box-shadow: var(--nm-shadow);
    overflow: hidden;
}

.notification-manager .nm-templates-section__summary,
.notification-manager .nm-templates-subsection__summary {
    list-style: none;
    cursor: pointer;
    font-weight: 600;
    padding: 14px 16px;
    background: linear-gradient(180deg, #ffffff 0%, var(--nm-surface-2) 100%);
    border-bottom: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background var(--nm-transition);
}

.notification-manager .nm-templates-section__summary:hover,
.notification-manager .nm-templates-subsection__summary:hover {
    background: var(--nm-accent-soft);
}

.notification-manager .nm-templates-section__summary::before,
.notification-manager .nm-templates-subsection__summary::before {
    content: "";
    width: 0.45em;
    height: 0.45em;
    border-inline-end: 2px solid var(--nm-accent);
    border-bottom: 2px solid var(--nm-accent);
    transform: rotate(-45deg);
    transition: transform var(--nm-transition);
    flex: 0 0 auto;
}

.notification-manager[dir="rtl"] .nm-templates-section__summary::before,
.notification-manager[dir="rtl"] .nm-templates-subsection__summary::before {
    transform: rotate(135deg);
}

.notification-manager .nm-templates-section[open] > .nm-templates-section__summary::before,
.notification-manager .nm-templates-subsection[open] > .nm-templates-subsection__summary::before {
    transform: rotate(45deg);
}

.notification-manager[dir="rtl"] .nm-templates-section[open] > .nm-templates-section__summary::before,
.notification-manager[dir="rtl"] .nm-templates-subsection[open] > .nm-templates-subsection__summary::before {
    transform: rotate(-135deg);
}

.notification-manager .nm-templates-section[open] > .nm-templates-section__summary,
.notification-manager .nm-templates-subsection[open] > .nm-templates-subsection__summary {
    border-bottom-color: var(--nm-border);
    color: var(--nm-accent);
}

.notification-manager .nm-templates-section__summary::-webkit-details-marker,
.notification-manager .nm-templates-subsection__summary::-webkit-details-marker {
    display: none;
}

.notification-manager .nm-templates-section__summary .nm-muted,
.notification-manager .nm-templates-subsection__summary .nm-muted {
    margin-inline-start: auto;
    font-weight: 500;
    background: var(--nm-accent-soft);
    color: var(--nm-accent);
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 0.85em;
}

.notification-manager .nm-templates-section__body {
    padding: 12px 14px 14px;
    background: var(--nm-bg);
}

.notification-manager .nm-templates-subsection {
    margin: 0 0 10px;
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius-sm);
    background: var(--nm-surface);
}

.notification-manager .nm-templates-subsection:last-child {
    margin-bottom: 0;
}

.notification-manager .nm-templates-subsection__summary {
    padding: 11px 12px;
    font-size: 0.95em;
}

.notification-manager .nm-templates-subsection__body {
    padding: 0 8px 10px;
    background: var(--nm-surface);
}

.notification-manager .nm-templates-table {
    table-layout: fixed;
    width: 100%;
}

.notification-manager .nm-templates-table .nm-col-name { width: 38%; }
.notification-manager .nm-templates-table .nm-col-audience { width: 14%; }
.notification-manager .nm-templates-table .nm-col-panels { width: 26%; }
.notification-manager .nm-templates-table .nm-col-active { width: 10%; }
.notification-manager .nm-templates-table .nm-col-actions { width: 12%; }

.notification-manager .nm-template-title {
    font-weight: 600;
    display: block;
    line-height: 1.45;
    word-break: break-word;
}

@media (max-width: 900px) {
    .notification-manager .nm-templates-table .nm-col-audience,
    .notification-manager .nm-templates-table th.nm-col-audience,
    .notification-manager .nm-templates-table td.nm-col-audience {
        display: none;
    }
    .notification-manager .nm-templates-table .nm-col-name { width: 44%; }
    .notification-manager .nm-templates-table .nm-col-panels { width: 34%; }
}

.notification-manager .nm-nav__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4em;
    height: 1.4em;
    padding: 0 6px;
    margin-inline-start: 6px;
    border-radius: 999px;
    background: var(--nm-danger);
    color: #fff;
    font-size: 0.75em;
    font-weight: 700;
    line-height: 1;
}
/* display:inline-flex above must not defeat the HTML hidden attribute */
.notification-manager .nm-nav__badge[hidden] {
    display: none !important;
}

.notification-manager .nm-perm-matrix th.nm-perm-matrix__cap {
    font-size: 0.85em;
    white-space: nowrap;
}

.notification-manager .nm-perm-matrix__cell {
    text-align: center;
    vertical-align: middle;
}

.notification-manager .nm-perm-group-form .nm-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: 0.4rem 0.75rem;
    margin-top: 0.35rem;
}

.notification-manager .nm-code {
    display: block;
    overflow: auto;
    padding: 12px 14px;
    margin: 8px 0 16px;
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius-sm);
    background: #0f172a;
    color: #e2e8f0;
    font-size: 12px;
    line-height: 1.45;
    white-space: pre;
}

.notification-manager .nm-api-docs h4 {
    margin: 18px 0 6px;
}

.notification-manager .nm-perm-dialog {
    position: fixed;
    inset: 0;
    margin: auto;
    width: min(720px, 94vw);
    max-height: min(88vh, 900px);
    padding: 0;
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
    background: var(--nm-surface);
    color: var(--nm-text);
}

.notification-manager .nm-perm-dialog::backdrop {
    background: rgba(15, 23, 42, 0.45);
}

.notification-manager .nm-perm-dialog__form {
    display: flex;
    flex-direction: column;
    max-height: min(88vh, 900px);
}

.notification-manager .nm-perm-dialog__head,
.notification-manager .nm-perm-dialog__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--nm-border);
}

.notification-manager .nm-perm-dialog__foot {
    border-bottom: 0;
    border-top: 1px solid var(--nm-border);
    justify-content: flex-end;
}

.notification-manager .nm-perm-dialog__body {
    padding: 14px 16px 18px;
    overflow: auto;
}

.notification-manager .nm-perm-sections {
    display: grid;
    gap: 12px;
    margin: 12px 0 18px;
}

.notification-manager .nm-perm-section {
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius-sm);
    padding: 12px 14px;
    background: var(--nm-bg, #f8fafc);
}

.notification-manager .nm-perm-section__title {
    margin: 0 0 4px;
    font-size: 1.05em;
}

.notification-manager .nm-perm-section__help {
    margin: 0 0 10px;
    color: var(--nm-muted, #64748b);
    font-size: 0.9em;
}

.notification-manager .nm-perm-section__caps {
    display: grid;
    gap: 6px;
}

.notification-manager .nm-perm-cap--open {
    font-weight: 600;
}

.notification-manager .nm-perm-cap-child {
    margin-inline-start: 1rem;
}

.notification-manager .nm-perm-group-form .nm-check {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    margin: 0;
    font-weight: 400;
}

.notification-manager .nm-check--center {
    justify-content: center;
}

.notification-manager .nm-talk-bind-picker {
    display: grid;
    gap: 6px;
    position: relative;
}

.notification-manager .nm-talk-bind-table td {
    vertical-align: top;
}

.notification-manager .nm-talk-bind-results {
    position: absolute;
    z-index: 5;
    left: 0;
    right: 0;
    top: 100%;
}

.notification-manager .nm-panel-divider {
    border: 0;
    border-top: 1px solid var(--nm-border);
    margin: 14px 0;
}

.notification-manager .nm-panel-section__subtitle {
    margin: 0 0 10px;
    font-size: 1.05em;
    font-weight: 600;
}

.notification-manager .nm-check-grid {
    display: grid;
    gap: 8px;
    margin-top: 6px;
}

.notification-manager .nm-check-grid--templates {
    grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr));
    gap: 12px 16px;
    margin-top: 10px;
}

.notification-manager .nm-check--template {
    align-items: flex-start;
    gap: 0.55rem;
    padding: 8px 10px;
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius-sm);
    background: var(--nm-surface, #fff);
}

.notification-manager .nm-check--template .nm-check__body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 2px;
}

.notification-manager .nm-check--template .nm-check__title,
.notification-manager .nm-check--template .nm-check__code {
    display: block;
    line-height: 1.35;
}

.notification-manager .nm-check--template .nm-check__title {
    font-weight: 600;
}

.notification-manager .nm-check--template .nm-check__code {
    margin-top: 2px;
    font-size: 0.82em;
    color: var(--nm-muted, #64748b);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    direction: ltr;
    unicode-bidi: isolate;
}

.notification-manager .nm-check--template input {
    margin-top: 0.2em;
}

.notification-manager .nm-talk-bind-row {
    margin-bottom: 10px;
}

.notification-manager .nm-panel-section {
    margin: 16px 0;
    padding: 14px 16px;
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius-sm);
    background: var(--nm-surface-2, #f7f8fa);
}

.notification-manager .nm-panel-section__title {
    margin: 0 0 10px;
    font-size: 1.02rem;
    font-weight: 650;
}

.notification-manager .nm-panel-section--alert {
    border-color: #c9a227;
    background: #fffbeb;
}

.notification-manager .nm-asterisk-prompt__custom {
    margin-top: 8px;
}

.notification-manager .nm-asterisk-sound-ref {
    margin: 12px 0 16px;
    padding: 10px 12px;
    border: 1px dashed var(--nm-border);
    border-radius: var(--nm-radius-sm);
    background: var(--nm-surface, #fff);
}

.notification-manager .nm-asterisk-sound-ref > summary {
    cursor: pointer;
    font-weight: 600;
}

.notification-manager .nm-asterisk-sound-ref .nm-table-wrap {
    max-height: 280px;
    overflow: auto;
    margin-top: 8px;
}

.notification-manager .nm-filter-select__search {
    margin-bottom: 6px;
}

.notification-manager .nm-filter-select__list option[hidden] {
    display: none;
}

.notification-manager .nm-schedule__card {
    padding: 12px 14px;
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius-sm);
    background: var(--nm-surface, #fff);
}

.notification-manager .nm-schedule__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 720px) {
    .notification-manager .nm-schedule__grid {
        grid-template-columns: 1fr;
    }
}

.notification-manager .nm-schedule__input-wrap {
    position: relative;
}

.notification-manager .nm-schedule__badge {
    position: absolute;
    inset-inline-end: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    font-weight: 650;
    letter-spacing: 0.02em;
    color: var(--nm-muted, #6b7280);
    pointer-events: none;
}

.notification-manager .nm-schedule__actions {
    margin-top: 10px;
}

.notification-manager .nm-client-summary {
    margin: 16px 0;
    padding: 14px 16px;
    border: 1px solid var(--nm-border, #d8dee6);
    border-radius: 8px;
    background: #f8fafc;
}

.nm-client-tab-page .nm-client-summary {
    margin: 0;
    padding: 8px 0 16px;
    border: 0;
    background: transparent;
}

.nm-client-tab-page .nm-client-summary .nm-table-wrap {
    max-height: none;
}

.notification-manager .nm-client-summary__title {
    margin: 0 0 8px;
    font-size: 1.05rem;
    font-weight: 650;
}

.notification-manager .nm-client-summary__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0 12px;
}

.notification-manager .nm-client-summary__tab {
    border: 1px solid var(--nm-border, #d8dee6);
    background: #fff;
    border-radius: 999px;
    padding: 4px 12px;
    cursor: pointer;
    font-size: 0.85rem;
}

.notification-manager .nm-client-summary__tab.is-active {
    background: #0f172a;
    border-color: #0f172a;
    color: #fff;
}

.notification-manager .nm-client-summary__panel[hidden] {
    display: none;
}

.notification-manager .nm-client-summary .nm-table-wrap {
    max-height: 320px;
    overflow: auto;
}

.notification-manager .nm-click-call {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin: 8px 0 12px;
    padding: 10px 12px;
    border: 1px solid var(--nm-border, #d8dee6);
    border-radius: 8px;
    background: #fff;
}

.notification-manager .nm-click-call__title {
    margin: 0;
    font-weight: 650;
    width: 100%;
}

.notification-manager .nm-click-call__row {
    display: grid;
    grid-template-columns: minmax(8rem, 1.2fr) minmax(8rem, 1.2fr) minmax(7rem, 1fr) auto;
    align-items: end;
    gap: 8px 12px;
    width: 100%;
}

.notification-manager .nm-click-call__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.notification-manager .nm-click-call__field input,
.notification-manager .nm-click-call__field select,
.notification-manager .nm-click-call__go {
    height: 36px;
    min-height: 36px;
    box-sizing: border-box;
}

.notification-manager .nm-click-call__go {
    align-self: end;
}

.notification-manager .nm-click-call__field input,
.notification-manager .nm-click-call__field select {
    min-width: 10rem;
}

.notification-manager .nm-click-call__review {
    margin: 4px 0 0;
    width: 100%;
    font-weight: 650;
    color: #b45309;
}

.notification-manager.nm-overview-call {
    margin: 0 0 16px;
}

.notification-manager .nm-ts {
    display: inline-block;
    direction: ltr;
    unicode-bidi: isolate;
    white-space: nowrap;
}

.notification-manager .nm-click-call__status {
    margin: 0;
    width: 100%;
}

.notification-manager .nm-assign-phone {
    display: inline-block;
    margin: 0 0 10px;
    padding: 6px 10px;
    background: #fef08a;
    color: #1e293b;
    font-weight: 650;
    border-radius: 6px;
    unicode-bidi: isolate;
}

.notification-manager .nm-assign-phone[hidden] {
    display: none !important;
}

.notification-manager td.nm-assign-from.is-mark {
    background: #fef08a;
}

.notification-manager .nm-unassigned__search-label {
    display: block;
    font-weight: 600;
    margin: 0 0 4px;
}

.notification-manager .nm-unassigned__list[aria-busy="true"] {
    opacity: 0.65;
    pointer-events: none;
}

.notification-manager .nm-assign-reason {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 10px 0;
    font-weight: 600;
}

.notification-manager .nm-assign-reason textarea {
    min-height: 4.5rem;
    resize: vertical;
}

.notification-manager .nm-click-call-dialog {
    width: min(420px, 94vw);
    padding: 16px;
    border: 1px solid var(--nm-border, #d8dee6);
    border-radius: 8px;
}

.notification-manager .nm-click-call-dialog::backdrop {
    background: rgba(15, 23, 42, 0.45);
}

.notification-manager .nm-click-call-dialog__exts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 12px;
}

.notification-manager .nm-unmatched-calls {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--nm-border, #d8dee6);
}

.notification-manager .nm-unmatched-calls h4 {
    margin: 0 0 6px;
    font-size: 1rem;
}

.notification-manager .nm-assign-call {
    white-space: nowrap;
}

@media (max-width: 720px) {
    .notification-manager .nm-click-call {
        align-items: stretch;
    }

    .notification-manager .nm-click-call__row {
        grid-template-columns: 1fr;
        width: 100%;
    }
}

.notification-manager .nm-voice-lab__search-row {
    display: grid;
    grid-template-columns: 1fr minmax(120px, 160px) auto;
    gap: 8px;
    margin: 10px 0 12px;
}

@media (max-width: 720px) {
    .notification-manager .nm-voice-lab__search-row {
        grid-template-columns: 1fr;
    }
}

.notification-manager .nm-voice-lab__player {
    position: sticky;
    top: 8px;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 12px;
    border: 1px solid var(--nm-border, #d8dee6);
    border-radius: 8px;
    background: #fff;
}

.notification-manager .nm-voice-lab__player audio {
    max-width: 100%;
    min-width: 220px;
}

.notification-manager .nm-voice-lab__table {
    max-height: 420px;
    overflow: auto;
}

.notification-manager .nm-voice-lab__test {
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px dashed var(--nm-border, #d8dee6);
}

.notification-manager .nm-voice-lab__otp[hidden] {
    display: none !important;
}

.notification-manager .nm-voice-lab__test-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.notification-manager .nm-req::after {
    content: " *";
    color: #b45309;
}

.notification-manager .nm-panel-form .form-control {
    max-width: 36rem;
}

/*
 * WHMCS intl-tel-input (separateDialCode) expects:
 *   .selected-flag { display:table }
 *   .iti-flag { position:absolute; left }
 *   .selected-dial-code { display:table-cell; padding-left:28px }
 * A prior flex override stacked flag above +98. Restore table layout + LTR.
 */
.notification-manager .intl-tel-input {
    direction: ltr !important;
    unicode-bidi: isolate;
    width: 100%;
    max-width: 36rem;
    display: inline-block;
}

.notification-manager .intl-tel-input .flag-container {
    direction: ltr !important;
    left: 0;
    right: auto;
}

.notification-manager .intl-tel-input.separate-dial-code .selected-flag {
    display: table !important;
    position: relative;
    height: 100%;
    width: auto !important;
    min-width: 78px;
    padding: 0 22px 0 8px !important;
    background-color: rgba(15, 23, 42, 0.06);
    box-sizing: border-box;
}

.notification-manager .intl-tel-input.separate-dial-code .selected-flag .iti-flag {
    position: absolute !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 8px !important;
    right: auto !important;
    margin: auto 0 !important;
    flex: none !important;
}

.notification-manager .intl-tel-input.separate-dial-code .selected-dial-code {
    display: table-cell !important;
    vertical-align: middle !important;
    padding-left: 28px !important;
    padding-right: 0 !important;
    margin: 0 !important;
    white-space: nowrap;
    direction: ltr !important;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.notification-manager .intl-tel-input.separate-dial-code .selected-flag .iti-arrow {
    position: absolute !important;
    top: 50% !important;
    right: 6px !important;
    left: auto !important;
    margin-top: -2px !important;
}

/* Keep national number clear of the dial-code box (WHMCS padding is too tight). */
.notification-manager .intl-tel-input.separate-dial-code input.form-control,
.notification-manager .intl-tel-input.separate-dial-code input[type="tel"],
.notification-manager .intl-tel-input.separate-dial-code input[type="text"] {
    max-width: none;
    direction: ltr;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    padding-right: 12px !important;
    padding-left: 100px !important;
}

.notification-manager .intl-tel-input.separate-dial-code.iti-sdc-2 input.form-control,
.notification-manager .intl-tel-input.separate-dial-code.allow-dropdown.iti-sdc-2 input.form-control {
    padding-left: 92px !important;
}

.notification-manager .intl-tel-input.separate-dial-code.iti-sdc-3 input.form-control,
.notification-manager .intl-tel-input.separate-dial-code.allow-dropdown.iti-sdc-3 input.form-control {
    padding-left: 104px !important;
}

.notification-manager .intl-tel-input.separate-dial-code.iti-sdc-4 input.form-control,
.notification-manager .intl-tel-input.separate-dial-code.allow-dropdown.iti-sdc-4 input.form-control {
    padding-left: 114px !important;
}

.notification-manager .intl-tel-input.separate-dial-code.iti-sdc-5 input.form-control,
.notification-manager .intl-tel-input.separate-dial-code.allow-dropdown.iti-sdc-5 input.form-control {
    padding-left: 124px !important;
}

.notification-manager .nm-panel-tools {
    margin-top: 8px;
}

.notification-manager .nm-inline-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

@media (prefers-reduced-motion: reduce) {
    .notification-manager *,
    .notification-manager *::before,
    .notification-manager *::after {
        transition: none !important;
    }
}

/* Panel list status rows */
.notification-manager .nm-panels-table tbody tr.nm-panel-row--ok {
    background: #eaf7ef;
}
.notification-manager .nm-panels-table tbody tr.nm-panel-row--warn {
    background: #fff4e5;
}
.notification-manager .nm-panels-table tbody tr.nm-panel-row--inactive {
    background: #fdeceb;
}
.notification-manager .nm-panels-table tbody tr.nm-panel-row--pending {
    background: transparent;
}
.notification-manager .nm-btn-edit {
    color: #fff !important;
    background: #2563eb !important;
    border-color: #1d4ed8 !important;
}
.notification-manager .nm-btn-delete,
.notification-manager button.nm-btn-delete {
    color: #fff !important;
    background: #dc2626 !important;
    border-color: #b91c1c !important;
}
.notification-manager .nm-panel-live__refresh {
    width: 28px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #2563eb;
}
.notification-manager .nm-panel-live__refresh:hover,
.notification-manager .nm-panel-live__refresh:focus {
    color: #1d4ed8;
}
.notification-manager .nm-icon-refresh {
    display: block;
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
}
.notification-manager .nm-panel-live__refresh:disabled .nm-icon-refresh {
    animation: nm-spin 0.8s linear infinite;
}
@keyframes nm-spin {
    to { transform: rotate(360deg); }
}

/* Inbox denser layout */
.notification-manager .nm-card--inbox {
    max-width: none;
}
.notification-manager .nm-inbox-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin: 12px 0 14px;
}
.notification-manager .nm-inbox-search {
    flex: 1 1 220px;
    margin: 0;
}
.notification-manager .nm-inbox-pagesize {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}
.notification-manager .nm-inbox-pagesize .form-control {
    width: auto;
    display: inline-block;
}
.notification-manager .nm-inbox-list {
    min-height: 420px;
    max-height: min(70vh, 900px);
    overflow: auto;
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius-sm);
    background: var(--nm-surface);
}
.notification-manager .nm-inbox-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--nm-border);
}
.notification-manager .nm-inbox-item__main {
    min-width: 0;
}
.notification-manager .nm-inbox-item__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.75rem;
    margin-bottom: 6px;
}
.notification-manager .nm-inbox-item__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}
.notification-manager .nm-inbox-pager {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    margin-top: 12px;
}
.notification-manager .nm-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

/* Settings tabs */
.notification-manager .nm-settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 16px;
    border-bottom: 1px solid var(--nm-border);
    padding-bottom: 8px;
}
.notification-manager .nm-settings-tabs a {
    display: inline-block;
    padding: 8px 12px;
    border-radius: var(--nm-radius-sm);
    text-decoration: none;
    color: var(--nm-text);
}
.notification-manager .nm-settings-tabs a.is-active {
    background: var(--nm-accent, #0f766e);
    color: #fff;
}
.notification-manager .nm-header__lang {
    display: inline-flex;
    gap: 4px;
    margin-inline-end: 8px;
}
.notification-manager .nm-header__lang a {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--nm-border);
    text-decoration: none;
    color: var(--nm-text);
    font-size: 12px;
}
.notification-manager .nm-header__lang a.is-active {
    background: var(--nm-accent, #0f766e);
    color: #fff;
    border-color: transparent;
}

/* Client-area homepage flash (loaded via ClientAreaHeadOutput) */
.nm-client-flash {
    margin: 0 0 1.25rem;
    padding: 1rem 1.15rem;
    border-radius: 8px;
    border: 1px solid #b6d4fe;
    background: #eef5ff;
}
.nm-client-flash__title {
    display: block;
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
}
.nm-client-flash__body {
    margin: 0 0 0.75rem;
    color: #334155;
}
.nm-client-flash__cta {
    display: inline-block;
}

.notification-manager .nm-voice-steps {
    margin: 0;
    padding-inline-start: 1.2rem;
}
.notification-manager .nm-voice-step {
    margin: 0.35rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.notification-manager .nm-play-chain {
    white-space: nowrap;
}
.notification-manager .nm-voice-steps-card {
    margin-top: 12px;
}
.notification-manager .nm-spoken-preview {
    margin: 12px 0;
    padding: 12px;
    border: 1px solid var(--nm-border, #d8dee6);
    border-radius: 8px;
    background: #f8fafc;
}
.notification-manager .nm-spoken-sentence {
    font-size: 1.05rem;
    line-height: 1.7;
    margin: 0 0 10px;
}
.notification-manager .nm-placeholder-map {
    width: 100%;
    font-size: 0.92rem;
}
.notification-manager .nm-voice-drops {
    margin: 0 0 10px;
    padding-inline-start: 1.2rem;
}
.notification-manager .nm-voice-drop {
    color: #b91c1c;
}
.notification-manager .nm-template-spoken {
    display: block;
    margin-top: 4px;
    font-size: 0.9rem;
    color: #475569;
    line-height: 1.5;
}
@media (max-width: 640px) {
    .notification-manager .nm-spoken-preview {
        padding: 10px;
    }
}
.notification-manager .nm-call-player-bar {
    position: sticky;
    top: 8px;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 12px;
    border: 1px solid var(--nm-border, #d8dee6);
    border-radius: 8px;
    background: #fff;
}
.notification-manager .nm-call-player {
    width: min(100%, 420px);
    min-width: 220px;
    height: 36px;
}
.notification-manager .nm-call-player-status {
    font-size: 1.15rem;
    font-weight: 650;
    color: #1e293b;
    line-height: 1.4;
}
.notification-manager .nm-call-player-status.is-missing {
    color: #b91c1c;
    font-size: 1.25rem;
}
.notification-manager .nm-call-player-status.is-loading {
    color: #1d4ed8;
}
.notification-manager .nm-call-play {
    min-height: 36px;
    min-width: 4.5rem;
}

.notification-manager .nm-unassigned__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: flex-end;
    margin: 0 0 12px;
}

.notification-manager .nm-unassigned__search {
    flex: 1 1 12rem;
}

.notification-manager .nm-unassigned__layout {
    display: grid;
    grid-template-columns: minmax(20rem, 1fr) minmax(16rem, 1fr);
    gap: 16px;
    align-items: start;
}

.notification-manager .nm-unassigned__list {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.notification-manager .nm-unassigned__list table {
    table-layout: auto;
    width: 100%;
}

.notification-manager .nm-unassigned__list th:first-child,
.notification-manager .nm-unassigned__num {
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
    min-width: 8.5rem;
}

.notification-manager .nm-unassigned__list tr.is-active td {
    background: #eef4ff;
}

.notification-manager .nm-unassigned__detail {
    min-width: 0;
}

.notification-manager .nm-unassigned__row-actions {
    white-space: nowrap;
}

.notification-manager .nm-unassigned__row-actions .btn {
    margin: 0 2px 4px 0;
}

.notification-manager .nm-unassigned__actions {
    margin: 0 0 12px;
}

.notification-manager .nm-unassigned__pager {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 8px 0 12px;
}

@media (max-width: 900px) {
    .notification-manager .nm-unassigned__layout {
        grid-template-columns: 1fr;
    }
}

.notification-manager .nm-calls-range {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    align-items: end;
    margin: 0 0 12px;
}

.notification-manager .nm-calls-range label,
.notification-manager .nm-calls-range__bound,
.notification-manager .nm-calls-range__lookback {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    font-weight: 600;
}

.notification-manager .nm-calls-range .form-control,
.notification-manager .nm-calls-range .btn {
    height: 36px;
    min-height: 36px;
    max-height: 36px;
    box-sizing: border-box;
    padding-top: 6px;
    padding-bottom: 6px;
    line-height: 1.25;
}

.notification-manager .nm-calls-range input[type="date"].form-control {
    -webkit-appearance: none;
    appearance: none;
}

.notification-manager .nm-calls-range .nm-filter-date-pair {
    min-width: 16.5rem;
}

.notification-manager .nm-calls-pager {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 8px 0 12px;
}

.notification-manager .nm-dir-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 650;
    white-space: nowrap;
}

.notification-manager .nm-dir-badge.is-in {
    background: #ecfdf3;
    color: #166534;
}

.notification-manager .nm-dir-badge.is-out {
    background: #eef4ff;
    color: #1e40af;
}

.notification-manager .nm-client-call-search { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0; }
.notification-manager .nm-client-call-search label { flex-basis: 100%; }
.notification-manager .nm-client-call-search .form-control { flex: 1 1 200px; width: auto; min-width: 0; max-width: 420px; }
.notification-manager .nm-voice-lab__voice { margin: 16px 0; padding: 12px 14px; border: 1px solid #e3e6ea; border-radius: 8px; }
.notification-manager .nm-voice-lab__profile { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 12px; }
.notification-manager .nm-voice-lab__profile .form-control { width: 100%; }
.notification-manager .nm-voice-lab__save { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin: 8px 0; }
.notification-manager .nm-voice-lab__save label { flex-basis: 100%; margin: 0; }
.notification-manager .nm-voice-lab__save .form-control { flex: 1 1 220px; width: auto; min-width: 0; }
.notification-manager .nm-voice-lab__clip-editor { padding: 8px 0; }
.notification-manager .nm-voice-lab__clip-editor textarea { width: 100%; }
