/* Dark Mode CSS Variables and Theme Support */
:root {
  --pt-primary: #667eea;
  --pt-primary-dark: #5a6fd8;
  --pt-secondary: #764ba2;
  --pt-bg-primary: #ffffff;
  --pt-bg-secondary: #f8f9fa;
  --pt-bg-tertiary: #e9ecef;
  --pt-text-primary: #212529;
  --pt-text-secondary: #6c757d;
  --pt-text-muted: #888;
  --pt-border: #dee2e6;
  --pt-shadow: rgba(0, 0, 0, 0.1);
  --pt-shadow-hover: rgba(0, 0, 0, 0.15);
  /* Override Bootstrap variables for light mode */
  --bs-body-bg: var(--pt-bg-primary);
  --bs-body-color: var(--pt-text-primary);
  --bs-secondary-bg: var(--pt-bg-secondary);
  --bs-tertiary-bg: var(--pt-bg-tertiary);
  --bs-border-color: var(--pt-border);
}
[data-theme="dark"] {
  --pt-primary: #7c8ef7;
  --pt-primary-dark: #6b7ee6;
  --pt-secondary: #8b5fbf;
  --pt-bg-primary: #1a1d29;
  --pt-bg-secondary: #242938;
  --pt-bg-tertiary: #2e3441;
  --pt-text-primary: #e9ecef;
  --pt-text-secondary: #adb5bd;
  --pt-text-muted: #868e96;
  --pt-border: #495057;
  --pt-shadow: rgba(0, 0, 0, 0.3);
  --pt-shadow-hover: rgba(0, 0, 0, 0.4);
  /* Override Bootstrap variables for dark mode */
  --bs-body-bg: var(--pt-bg-primary);
  --bs-body-color: var(--pt-text-primary);
  --bs-secondary-bg: var(--pt-bg-secondary);
  --bs-tertiary-bg: var(--pt-bg-tertiary);
  --bs-border-color: var(--pt-border);
  --bs-dark-rgb: 233, 236, 239;
  --bs-light-rgb: 52, 58, 64;
}
/* Apply theme to body and main elements */
body {
  background-color: var(--pt-bg-primary) !important;
  color: var(--pt-text-primary) !important;
  transition: background-color 0.3s ease, color 0.3s ease;
}
/* Dark mode scrollbar */
::-webkit-scrollbar {
  width: 8px;
  background-color: var(--pt-bg-tertiary);
}
::-webkit-scrollbar-track {
  -webkit-box-shadow: inset 0 0 8px var(--pt-shadow);
  background-color: var(--pt-bg-tertiary);
}
::-webkit-scrollbar-thumb {
  background-color: var(--pt-text-secondary);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background-color: var(--pt-text-primary);
}
a,
a:not([href]):not([class]) {
  color: #006bb7;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
a:hover,
a:not([href]):not([class]):hover {
  color: #084298;
  text-decoration: none;
}
a:focus,
a:not([href]):not([class]):focus,
a:active,
a:not([href]):not([class]):active {
  color: #084298;
  text-decoration: none;
  font-weight: bold;
}
a:visited,
a:not([href]):not([class]):visited {
  text-decoration: none;
}
.cookie-banner {
  position: fixed;
  bottom: 142px;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.5);
  border: 3px solid #84C72C;
}
.cookie-banner a {
  color: #007bff;
  font-weight: 400;
  text-decoration: none;
}
.cookie-banner a:hover {
  color: #0070c0;
  text-decoration: none;
}
.cs-toast {
  display: none;
  padding: 1.5rem;
  color: #fff;
  z-index: 999;
  position: absolute;
  width: 25rem;
  top: 2rem;
  border-radius: 1rem;
  right: 2rem;
}
.cs-toast-icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 1rem;
  font-size: 2.5rem;
}
.cs-toast-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding-left: 1rem;
}
.cs-toast-body p {
  margin-bottom: 0;
}
.cs-toast-visible {
  display: flex;
  flex-direction: row;
  animation: fadein 1.5s;
}
.table-scroll {
  max-height: 300px;
  overflow-y: scroll;
}
a,
.btn-link {
  color: #006bb7;
}
.btn-primary {
  color: #fff;
  background-color: #1b6ec2;
  border-color: #1861ac;
}
.content {
  padding-top: 1.1rem;
}
h1:focus {
  outline: none;
}
.valid.modified:not([type=checkbox]) {
  outline: 1px solid #26b050;
}
.invalid {
  outline: 1px solid #e52200;
}
.validation-message {
  color: #e52200;
}
#blazor-error-ui {
  background: lightyellow;
  bottom: 0;
  box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
  display: none;
  left: 0;
  padding: 0.6rem 1.25rem 0.7rem 1.25rem;
  position: fixed;
  width: 100%;
  z-index: 1000;
}
#blazor-error-ui .dismiss {
  cursor: pointer;
  position: absolute;
  right: 0.75rem;
  top: 0.5rem;
}
.blazor-error-boundary {
  background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 0.55555556rem, #b32121;
  padding: 1rem 1rem 1rem 3.7rem;
  color: white;
}
.blazor-error-boundary::after {
  content: "An error has occurred.";
}
.thankyou {
  background: #57aaae;
  padding: 8%;
}
.thankyou-header-img {
  height: 10rem;
  width: auto;
  margin: auto;
}
.duplicates-card {
  display: flex;
  flex-direction: column;
  background-color: #F5F5F5;
  padding: 15px 20px;
  gap: 20px;
  border-radius: 10px;
}
.duplicates-card .duplicates-header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.duplicates-card .duplicates-header .duplicates-header-container {
  display: flex;
  flex-direction: column;
}
.duplicates-card .duplicates-header .duplicates-header-container .duplicates-header-text {
  font-weight: bold;
  font-size: 11px;
  opacity: 0.7;
}
.duplicates-card .duplicates-header .duplicates-header-container .duplicates-header-value {
  font-weight: 600;
  font-size: 16px;
}
.duplicates-card .duplicates {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
.duplicates-card .duplicate-merge-claim-card {
  padding: 1rem;
  border: 1px solid #FCFCFC00;
  border-radius: 10px;
  width: auto;
  cursor: pointer;
  background-color: #E9E9E9;
  width: 400px;
}
.duplicates-card .claim-card-container {
  display: flex;
  justify-content: space-between;
  gap: 30px;
}
.duplicates-card .claim-card-item-group {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.duplicates-card .claim-card-item {
  display: flex;
  flex-direction: column;
}
.duplicates-card .claim-card-item .claim-card-item-label {
  font-weight: bold;
  font-size: 11px;
  opacity: 0.7;
}
.duplicates-card .claim-card-item .claim-card-item-value {
  font-weight: 600;
  font-size: 14px;
}
.duplicates-card .duplicate-merge-claim-card:hover {
  border: 1px solid #0D6EFD;
}
.duplicates-card .duplicates-notes {
  font-style: italic;
  font-size: 12px;
  opacity: 0.8;
}
.card-disabled {
  position: relative;
  opacity: 0.6;
  filter: grayscale(100%);
  pointer-events: none;
}
.bg-darkcyan {
  background-color: #1F9597 !important;
}
.bg-darkorange {
  background-color: #E3A54F !important;
}
.bg-brightcyan {
  background-color: #5DC7D2 !important;
}
.bg-lightblue {
  background-color: #76B8E8 !important;
}
.card-disabled::before {
  content: "DISABLED";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
  font-size: 2.5rem;
  color: rgba(0, 0, 0, 0.15);
  font-weight: bold;
  white-space: nowrap;
  pointer-events: none;
  text-align: center;
}
.image-circle {
  width: 32px;
  height: 32px;
  overflow: hidden;
  border-radius: 50%;
}
.image-circle img {
  width: 100%;
  height: auto;
}
.status-list {
  text-align: center;
  margin: 20px auto;
}
.status-list li {
  display: inline-block;
  margin-left: 5px;
  margin-right: 5px;
  width: 80px;
  position: relative;
}
.status-list li .bi {
  background: #ffff;
  z-index: 0;
}
.status-list li .bi::after {
  content: " ";
  background: #ccc;
  height: 5px;
  width: 90px;
  display: block;
  position: absolute;
  left: 0;
  top: 15px;
  z-index: -1;
}
.status-list span {
  font-size: 10px;
}
.status-done {
  color: #398d25;
}
.status-active {
  color: #0c95be;
}
.status-default {
  color: #eee;
}
.underwriterStatus li {
  width: 141px;
}
.underwriterStatus li .bi::after {
  width: 160px;
}
.pulse-page-wrapper {
  margin: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  box-sizing: border-box;
}
.pulse-policies-container {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  flex-direction: row;
  height: 80vh;
  width: 85vw;
  scroll-snap-type: x mandatory;
  white-space: normal;
  background-color: #f1f1f1;
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.policies-column-title {
  text-align: center;
  font-weight: bold;
  white-space: nowrap;
  margin-bottom: 10px;
}
.policies-column {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scroll-snap-align: start;
  border: 1px solid #ccc;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
  margin: 0 10px 0 10px;
  padding: 10px;
  background-color: #fff;
  border-radius: 5px;
  width: 350px;
}
.policies-column .card {
  font-size: 0.8em;
}
.pulse-policies-container::-webkit-scrollbar {
  height: 8px;
}
.pulse-policies-container::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}
.pulse-policies-container::-webkit-scrollbar-thumb:hover {
  background: #555;
}
.pulse-tag-text {
  border: 1px solid #000000;
  padding: 1px 5px 3px 5px;
  border-radius: 10px;
  display: inline-block;
  background-color: #84a9eb;
  color: white;
}
.pulse-tag-text-red {
  border: 1px solid #000000;
  padding: 1px 5px 3px 5px;
  border-radius: 10px;
  display: inline-block;
  background-color: #e74023;
  color: white;
}
.pulse-policies-count {
  display: inline-block;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  text-align: center;
  font-size: 10px;
  line-height: 25px;
  background-color: darkseagreen;
}
.pulse-tile {
  cursor: pointer;
}
.pulse-tile:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.dashboard-kanban-button {
  text-decoration: none;
  background: transparent;
  color: inherit;
  padding: 8px 16px;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-size: 14px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.3s, color 0.3s;
  margin-top: 0;
}
.dashboard-kanban-button:hover {
  background-color: rgba(0, 0, 0, 0.1);
  color: #007bff;
}
.fs-7 {
  font-size: 0.9rem;
}
.fs-8 {
  font-size: 0.875rem;
}
.fs-9 {
  font-size: 0.75rem;
}
.fs-10 {
  font-size: 0.7rem;
}
.fs-11 {
  font-size: 0.65rem;
}
.dropdown-menu {
  z-index: 1050;
}
.dropdown {
  position: relative;
}
.dropdown-menu.show {
  display: block !important;
}
.table td,
.table tr,
.table {
  overflow: visible !important;
}

/* ════════════════════════════════════════════════════════════════
   My Insured Book (Pulse) — global styles
   Shared across InsuredList, InsuredListItem, and all MIB modals.
   ════════════════════════════════════════════════════════════════ */

/* ── Tab nav ─────────────────────────────────────────────────── */
.pulse-tabs {
    display: flex;
    border-bottom: 1px solid #dee2e6;
    margin: .75rem 0 1rem;
}

.pulse-tabs .tab-btn {
    padding: .75rem 1.25rem;
    color: #475569;
    cursor: pointer;
    border: none;
    border-bottom: 3px solid transparent;
    background: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    transition: color .15s, border-color .15s;
    user-select: none;
}

.pulse-tabs .tab-btn:hover { color: #0b3d52; }

.pulse-tabs .tab-btn.active {
    color: #003A61;
    border-bottom-color: #008687;
    font-weight: 600;
}

.pulse-tabs .tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.6rem;
    height: 1.4rem;
    padding: 0 .45rem;
    background: #e2e8f0;
    color: #334155;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
}

.pulse-tabs .tab-btn.active .tab-count {
    background: #008687;
    color: #fff;
}

/* ── Main table ──────────────────────────────────────────────── */
#activeProcessTable {
    font-size: .9rem;
    table-layout: auto;
}

#activeProcessTable thead th {
    background: #e2e3e5;
    color: #41464b;
    font-weight: 600;
    border-color: #c4c8cb;
    vertical-align: top;
    padding: .55rem .65rem;
    position: relative;
    white-space: nowrap;
}

#activeProcessTable td {
    vertical-align: middle;
    padding: .45rem .6rem;
}

/* ── Column header internals ─────────────────────────────────── */
.col-head { display: flex; flex-direction: column; gap: .2rem; }

.col-head-label {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    color: #41464b;
    font-weight: 600;
    font-size: .875rem;
}

.col-head-label .head-icon { color: #64748b; font-size: .85rem; }

.col-head-input {
    margin-top: .2rem;
    width: 100%;
    font-size: .78rem;
    padding: .2rem .4rem;
    border: 1px solid #c4c8cb;
    border-radius: 3px;
    background: #fff;
    color: #212529;
    font-weight: 400;
}

.col-head-input::placeholder { color: #94a3b8; }
.col-head-input:focus { outline: none; border-color: #008687; }

.caret-btn {
    background: none;
    border: none;
    padding: 0 .15rem;
    color: #64748b;
    cursor: pointer;
    font-size: .8rem;
}

.caret-btn:hover { color: #003A61; }
.caret-btn.active { color: #008687; }

/* ── Popovers ────────────────────────────────────────────────── */
.popover-anchor { position: relative; display: inline-block; }

.popover-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 30;
    background: #fff;
    border: 1px solid #c4c8cb;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(15,23,42,.12);
    padding: .35rem 0;
    min-width: 180px;
}

.popover-menu .pop-opt {
    padding: .45rem .9rem;
    font-size: .85rem;
    color: #1e293b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

.popover-menu .pop-opt:hover { background: #f1f5f9; }
.popover-menu .pop-opt.selected { color: #008687; font-weight: 600; }

/* Lock-as-default toggle inside popover options */
.pop-lock {
    background: none;
    border: none;
    padding: 0 .15rem;
    color: #cbd5e1;             /* faded by default — unlocked icon */
    cursor: pointer;
    font-size: .9rem;
    line-height: 1;
    margin-left: .75rem;
    flex-shrink: 0;
    transition: color .12s, transform .12s;
}

.pop-lock:hover { color: #475569; transform: scale(1.1); }

.pop-lock.locked {
    color: #008687;             /* teal accent — locked */
}

.pop-lock.locked:hover { color: #006b6c; }

.popover-menu .pop-divider { height: 1px; background: #e2e8f0; margin: .25rem 0; }

.popover-menu .pop-custom {
    padding: .35rem .9rem .55rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    font-size: .8rem;
    color: #475569;
}

.popover-menu .pop-custom input {
    font-size: .8rem;
    padding: .2rem .4rem;
    border: 1px solid #c4c8cb;
    border-radius: 3px;
}

/* ── Insured cell ────────────────────────────────────────────── */
.insured-cell {
    display: flex;
    align-items: center;
    gap: .4rem;
}

.insured-cell.new-biz {
    background: #e0f2fe;
    box-shadow: inset 3px 0 0 #0ea5e9;
    padding-left: .4rem;
    margin-left: -.6rem;
    padding-right: .4rem;
    border-radius: 2px;
}

.insured-link {
    color: #0d6efd;
    text-decoration: none;
    font-weight: 500;
}

.insured-link:hover { text-decoration: underline; }

.row-caret {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: transparent;
    border: none;
    color: #475569;
    cursor: pointer;
    padding: 0;
    border-radius: 2px;
    font-size: .75rem;
}

.row-caret:hover { background: #e2e8f0; color: #0f172a; }
.row-caret.child-spacer { cursor: default; visibility: hidden; }

/* Amber flag — insured has policies outside the Pulse pipeline. */
.non-pulse-flag {
    color: #d97706;
    font-size: .85rem;
    margin-left: .25rem;
    cursor: help;
}

.pause-flag {
    flex-shrink: 0;
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 9px solid #dc2626;
    display: inline-block;
}

tr.child-row > td { background: #fafbfc; }

.insured-cell.is-child { padding-left: 1.6rem; }
tr.child-row .insured-link { color: #475569; }

/* ── Effective Date ──────────────────────────────────────────── */
.eff-date { display: flex; flex-direction: column; line-height: 1.2; }
.eff-date .eff-day { font-variant-numeric: tabular-nums; }
.eff-date .eff-day.past { color: #dc2626; font-weight: 600; }
.eff-date .eff-prox { font-size: .75rem; color: #008687; font-weight: 500; }
.eff-date .eff-prox.past { color: #dc2626; }

/* ── Status pill ─────────────────────────────────────────────── */
.status-pill {
    display: inline-flex;
    align-items: center;
    padding: .2rem .6rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-pill.open        { background: #e0f2fe; color: #0369a1; }
.status-pill.quoted-sent { background: #fef3c7; color: #92400e; }
.status-pill.quoted-rcvd { background: #dbeafe; color: #1e40af; }
.status-pill.bound       { background: #dcfce7; color: #166534; }
.status-pill.ordered     { background: #f3e8ff; color: #6b21a8; }
.status-pill.other       { background: #f1f5f9; color: #334155; }

/* ── DSLMT urgency badge ─────────────────────────────────────── */
.dslmt-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    padding: .2rem .55rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: .9rem;
    font-variant-numeric: tabular-nums;
}

.dslmt-badge.calm   { background: #dcfce7; color: #166534; }
.dslmt-badge.warn   { background: #fef3c7; color: #92400e; }
.dslmt-badge.urgent { background: #fee2e2; color: #991b1b; }

/* ── Notes cell ──────────────────────────────────────────────── */
.notes-cell {
    display: flex;
    align-items: center;
    gap: .35rem;
    min-width: 220px;
}

.notes-input {
    flex: 1;
    min-width: 0;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    padding: .25rem .45rem;
    font-size: .8rem;
    background: #fff;
    font-family: inherit;
}

.notes-input:focus {
    outline: none;
    border-color: #008687;
    box-shadow: 0 0 0 2px rgba(0,134,135,.15);
}

.notes-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #16a34a;
    color: #fff;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .12s, transform .12s, box-shadow .12s;
    font-size: .85rem;
    padding: 0;
}

.notes-add-btn:hover:not(:disabled) {
    background: #15803d;
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(21,128,61,.4);
}

.notes-add-btn:disabled { background: #cbd5e1; cursor: not-allowed; }

/* Clone-to-all-policies button — only renders on multi-policy parent rows. */
.notes-clone-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #6366f1;
    color: #fff;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .12s, transform .12s, box-shadow .12s;
    font-size: .85rem;
    padding: 0;
}

.notes-clone-btn:hover {
    background: #4f46e5;
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(99,102,241,.4);
}

.notes-badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .15rem .5rem;
    background: #f1f5f9;
    color: #475569;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    flex-shrink: 0;
    white-space: nowrap;
    transition: background .12s, border-color .12s, color .12s;
}

.notes-badge:hover { background: #e0e7ff; color: #1e3a8a; border-color: #93c5fd; }
.notes-badge.has   { background: #dbeafe; color: #1e40af; }
.notes-badge.has:hover { background: #bfdbfe; border-color: #60a5fa; }

/* ── Email cell ──────────────────────────────────────────────── */
.email-cell {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    flex-wrap: nowrap;
}

.email-btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .6rem;
    border-radius: 4px;
    border: 1px solid transparent;
    font-size: .78rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    transition: background .12s, color .12s, border-color .12s, box-shadow .12s, transform .12s;
}

.email-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(15,23,42,.2);
    filter: brightness(.94);
}

.email-btn.kind-renewal  { background: #0b3d52; color: #fff; }
.email-btn.kind-checkin  { background: #008687; color: #fff; }
.email-btn.kind-queued   { background: #0b3d52; color: #fff; }
.email-btn.kind-followup { background: #f59e0b; color: #78350f; }
.email-btn.kind-compose  { background: #fff; color: #0b3d52; border-color: #0b3d52; }

.cadence-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.6rem;
    padding: .15rem .4rem;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.cadence-pill.cad-1,
.cadence-pill.cad-7   { background: #fee2e2; color: #991b1b; }   /* urgent — within a week */
.cadence-pill.cad-15,
.cadence-pill.cad-30  { background: #fef3c7; color: #92400e; }   /* warming — 2–4 weeks */
.cadence-pill.cad-60,
.cadence-pill.cad-90  { background: #dbeafe; color: #1e40af; }   /* not urgent — 1–3 months */

.email-history-btn {
    background: none;
    border: none;
    padding: .15rem .25rem;
    cursor: pointer;
    font-size: 1rem;
    color: #475569;
    border-radius: 3px;
    transition: background .12s, transform .12s;
    line-height: 1;
}

.email-history-btn:hover { background: #e0e7ff; transform: scale(1.1); }

/* ── Pause pill switch ───────────────────────────────────────── */
.pause-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 24px;
    cursor: pointer;
}

.pause-switch input { opacity: 0; width: 0; height: 0; position: absolute; }

.pause-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #cbd5e1;
    border-radius: 999px;
    transition: background .2s;
    border: 1px solid #94a3b8;
}

.pause-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 2px;
    top: 2px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s;
    box-shadow: 0 1px 2px rgba(0,0,0,.15);
    z-index: 2;
}

.pause-slider::after {
    content: "Off";
    position: absolute;
    right: 7px;
    top: 50%;
    transform: translateY(-50%);
    font-size: .7rem;
    font-weight: 600;
    color: #64748b;
    letter-spacing: .02em;
    transition: color .2s;
    z-index: 1;
}

.pause-switch input:checked + .pause-slider { background: #008687; border-color: #006b6c; }
.pause-switch input:checked + .pause-slider::before { transform: translateX(36px); }
.pause-switch input:checked + .pause-slider::after {
    content: "On";
    right: auto;
    left: 8px;
    color: #fff;
}

/* ── Feature-disabled (read-only) cell overlay ──────────────── */
.feat-disabled {
    opacity: .55;
    pointer-events: none;
    position: relative;
}

.feat-disabled-cell {
    background-color: #f1f5f9;
    background-image: repeating-linear-gradient(
        135deg,
        transparent,
        transparent 4px,
        rgba(0,0,0,.04) 4px,
        rgba(0,0,0,.04) 8px
    );
    cursor: not-allowed;
}

.feat-disabled-cell .notes-input,
.feat-disabled-cell .notes-add-btn {
    cursor: not-allowed;
}

/* Notes cell when locked at the row level (multi-policy parent) — softens the input
   and the green ✓ button so it's clearly inert, while leaving the View-Notes badge
   at full opacity so users can still read history. */
.notes-cell-locked .notes-input,
.notes-cell-locked .notes-add-btn {
    opacity: .55;
}

/* ── Result summary & no-records ─────────────────────────────── */
.result-summary { font-size: .82rem; color: #64748b; }

.no-records-row td { text-align: center; color: #94a3b8; font-style: italic; padding: 2rem 1rem; }

/* ── Modal backdrop & card ───────────────────────────────────── */
.mib-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.5);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.mib-modal {
    background: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 720px;
    max-height: 88vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(15,23,42,.28);
}

.mib-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .9rem 1.1rem;
    border-bottom: 1px solid #e2e8f0;
}

.mib-modal-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: #1e293b;
}

.mib-modal-title .title-icon {
    width: 22px;
    height: 22px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #92400e;
    font-size: .75rem;
}

.mib-modal-title .subtitle { color: #475569; font-weight: 400; font-size: .9rem; }

.mib-modal-actions { display: flex; align-items: center; gap: .5rem; }

.mib-close-btn {
    background: none;
    border: none;
    color: #64748b;
    font-size: 1.35rem;
    line-height: 1;
    padding: .1rem .35rem;
    cursor: pointer;
}

.mib-close-btn:hover { color: #0f172a; }

.mib-modal-tabs {
    display: flex;
    padding: 0 1.1rem;
    border-bottom: 1px solid #e2e8f0;
    gap: 1.25rem;
}

.mib-modal-tabs .mtab {
    padding: .65rem 0;
    font-size: .9rem;
    cursor: pointer;
    border: none;
    background: none;
    user-select: none;
    color: #0d6efd;
}

.mib-modal-tabs .mtab:hover { text-decoration: underline; }
.mib-modal-tabs .mtab.active { color: #1e293b; font-weight: 600; border-bottom: 2px solid #1e293b; }

.mib-modal-body { overflow-y: auto; flex: 1; }

/* Notes table */
.mib-notes-table { width: 100%; border-collapse: collapse; font-size: .85rem; }

.mib-notes-table thead th {
    background: #e2e3e5;
    color: #41464b;
    text-align: left;
    padding: .5rem .75rem;
    font-weight: 600;
    font-size: .8rem;
    border-bottom: 1px solid #c4c8cb;
    position: sticky;
    top: 0;
}

.mib-notes-table tbody td {
    padding: .55rem .75rem;
    vertical-align: top;
    border-bottom: 1px solid #f1f5f9;
}

.mib-notes-table tbody tr:nth-child(even) td { background: #f8fafc; }
.mib-notes-table .when-col { white-space: nowrap; font-variant-numeric: tabular-nums; width: 80px; }
.mib-notes-table .who-col  { white-space: nowrap; width: 130px; }
.mib-notes-table .note-col { color: #0d6efd; }

.mib-empty-row td { color: #94a3b8; font-style: italic; text-align: center; padding: 2rem 1rem; }

/* Add note form */
.mib-add-form {
    border-top: 1px solid #e2e8f0;
    padding: .75rem 1.1rem;
    background: #f8fafc;
}

.mib-add-form textarea {
    width: 100%;
    min-height: 60px;
    resize: vertical;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: .4rem .55rem;
    font-size: .85rem;
    background: #fff;
    font-family: inherit;
}

.mib-add-form textarea:focus {
    outline: none;
    border-color: #008687;
    box-shadow: 0 0 0 2px rgba(0,134,135,.15);
}

.mib-add-form .form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: .5rem;
}

.mib-char-count { font-size: .75rem; color: #64748b; }
.mib-char-count.over { color: #dc2626; }

/* Email tables (Upcoming / History) */
.mib-email-table { width: 100%; border-collapse: collapse; font-size: .85rem; }

.mib-email-table thead th {
    background: #e2e3e5;
    color: #41464b;
    text-align: left;
    padding: .5rem .75rem;
    font-weight: 600;
    font-size: .8rem;
    border-bottom: 1px solid #c4c8cb;
}

.mib-email-table tbody td {
    padding: .55rem .75rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

/* Composer fields */
.mib-composer-body { padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .75rem; }

.mib-field label { font-size: .82rem; font-weight: 600; color: #334155; display: block; margin-bottom: .2rem; }

.mib-field input,
.mib-field .body-area {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: .4rem .6rem;
    font-size: .85rem;
    font-family: inherit;
    background: #fff;
}

.mib-field input:focus,
.mib-field textarea:focus {
    outline: none;
    border-color: #008687;
    box-shadow: 0 0 0 2px rgba(0,134,135,.15);
}

.mib-tpl-banner {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 4px;
    padding: .55rem .75rem;
    font-size: .8rem;
    color: #1e40af;
}

.mib-attachment-warning {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 4px;
    padding: .45rem .65rem;
    font-size: .78rem;
    color: #b91c1c;
    margin-bottom: .35rem;
}


/* CC agents — Radzen-style chip-summary box with a checkbox dropdown. */
.cc-field { position: relative; }

.cc-summary {
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: .3rem .55rem;
    background: #fff;
    cursor: pointer;
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    align-items: center;
    min-height: 38px;
    user-select: none;
}

.cc-summary:hover { border-color: #94a3b8; }

.cc-placeholder {
    color: #94a3b8;
    font-size: .85rem;
    flex: 1;
}

.cc-chip {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    background: #e0e7ff;
    color: #1e3a8a;
    border-radius: 999px;
    padding: .12rem .55rem;
    font-size: .78rem;
    font-weight: 500;
    line-height: 1.4;
}

.cc-chip-more {
    background: #f1f5f9;
    color: #475569;
}

.cc-chip-x {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    opacity: .65;
}

.cc-chip-x:hover { opacity: 1; }

.cc-caret {
    margin-left: auto;
    color: #64748b;
    font-size: .85rem;
    padding-left: .25rem;
}

.cc-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    box-shadow: 0 6px 16px rgba(15,23,42,.18);
    max-height: 240px;
    overflow-y: auto;
    z-index: 250;
}

.cc-option {
    padding: .4rem .65rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: .55rem;
    font-size: .85rem;
    color: #1e293b;
    border-bottom: 1px solid #f1f5f9;
    width: 100%;
    box-sizing: border-box;
}

.cc-option:last-child { border-bottom: none; }
.cc-option:hover { background: #f8fafc; }
.cc-option.selected { background: #eff6ff; }

.cc-option input[type="checkbox"] {
    pointer-events: none;
    flex: 0 0 auto;     /* fixed size — never grow, never shrink */
    margin: 0;
    width: 16px;
    height: 16px;
}

.cc-option .cc-name {
    flex: 1 1 auto;     /* take whatever horizontal space is left */
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cc-badge {
    margin-left: auto;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 3px;
    font-size: .68rem;
    padding: .05rem .35rem;
    text-transform: lowercase;
    font-weight: 600;
}

/* Modal footer */
.mib-modal-footer {
    padding: .75rem 1.1rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
}

/* Upcoming email Edit button */
.upcoming-edit {
    padding: .25rem .65rem;
    border-radius: 4px;
    background: #0d6efd;
    color: #fff;
    border: none;
    font-size: .82rem;
    font-weight: 500;
    cursor: pointer;
}

.upcoming-edit:hover { background: #0b5ed7; }

/* Email "New" badge */
.email-new-pill {
    display: inline-block;
    padding: .1rem .4rem;
    background: #dcfce7;
    color: #166534;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 600;
    margin-right: .25rem;
}
