:root {
  --bg: #f5f7fb; --surface: #fff; --text: #13203a; --muted: #667489; --border: #e2e7ef;
  --primary: #1d5fd1; --primary-dark: #174ca8; --primary-soft: #e8f0fd;
  --navy: #0d2142; --navy-2: #1a3a6b; --navy-text: #aab9d1;
  --danger: #d92d20; --danger-soft: #fdecea; --warn: #b54708; --warn-soft: #fff4e0;
  --ok: #12805c; --ok-soft: #e5f6ee; --radius: 10px;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 8px 22px rgba(16,24,40,.06);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.5;
  font: 14.5px/1.5 "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: var(--primary); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 1.65rem; letter-spacing: -.02em; margin: 0 0 .25rem; } h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; }
.count { font-size: 1rem; font-weight: 500; }
.inline { display: inline; margin: 0; }
.pre { white-space: pre-wrap; }

/* App shell: dark navy sidebar + top bar */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 236px; flex: none; background: var(--navy); color: var(--navy-text); padding: 18px 12px; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { font-weight: 700; color: var(--text); display: flex; align-items: center; gap: .6rem; }
.brand:hover { text-decoration: none; } .brand-lg { justify-content: center; font-size: 1.3rem; margin-bottom: 1rem; }
.sidebar .brand { color: #fff; font-size: 1.05rem; padding: 4px 10px 18px; }
.brand-mark { background: var(--primary); color: #fff; width: 30px; height: 30px; border-radius: 8px;
  display: inline-grid; place-items: center; font-size: .95rem; flex: none; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-sec { font-size: .68rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; padding: 14px 10px 6px; opacity: .6; }
.side-nav a { display: flex; align-items: center; gap: .7rem; color: var(--navy-text); padding: .55rem .7rem; border-radius: 8px; font-weight: 500; }
.side-nav a:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.side-nav a.active { background: var(--navy-2); color: #fff; font-weight: 600; }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.side-user { margin-top: auto; border-top: 1px solid rgba(255,255,255,.12); padding: 12px 6px 0; display: flex; flex-direction: column; gap: .6rem; }
.side-me { display: flex; align-items: center; gap: .65rem; color: #fff; font-weight: 600; line-height: 1.2; }
.side-me:hover { text-decoration: none; } .side-me small { display: block; color: var(--navy-text); font-weight: 400; font-size: .75rem; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.side-out { width: 100%; background: transparent; color: var(--navy-text); border-color: rgba(255,255,255,.18); }
.side-out:hover { background: rgba(255,255,255,.08); color: #fff; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: .8rem; background: var(--surface);
  border-bottom: 1px solid var(--border); padding: .65rem 1.5rem; }
.top-search { flex: 1; max-width: 480px; display: flex; align-items: center; gap: .5rem; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0 .75rem; color: var(--muted); }
.top-search input { border: 0; background: transparent; padding: .5rem 0; outline: none; }
.top-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(29,95,209,.15); }
.nav-spacer { flex: 1; }
.top-add .ico { stroke-width: 2.4; }
.nav-bell { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); position: relative; background: var(--surface); }
.nav-bell:hover { text-decoration: none; border-color: var(--primary); } .nav-bell.active { background: var(--primary-soft); }
.nav-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 8px; font-size: 1.2rem; padding: .2rem .6rem; cursor: pointer; }
.fab { display: none; }

.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 1.5rem 1.5rem 3rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.25rem; margin-bottom: 1.25rem; }
.narrow { max-width: 520px; margin-left: auto; margin-right: auto; }
.login-card { margin-top: 8vh; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid transparent;
  border-radius: 8px; padding: .55rem 1rem; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none !important; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); } .btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--primary-soft); color: var(--primary-dark); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); } .btn-ghost:hover { background: var(--bg); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: #f4c3c7; }
.btn-warn { background: var(--warn); color: #fff; }
.btn-sm { padding: .3rem .7rem; font-size: .85rem; } .btn-block { width: 100%; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(59,76,202,.35); outline-offset: 1px; }

/* Forms */
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: 1rem; }
.field > span { font-weight: 600; font-size: .88rem; }
.req { color: var(--danger); font-style: normal; }
input, select, textarea { font: inherit; padding: .55rem .7rem; border: 1px solid #cdd5e3; border-radius: 8px;
  background: #fff; color: var(--text); width: 100%; }
input:disabled { background: var(--bg); color: var(--muted); }
.has-error input, .has-error select { border-color: var(--danger); background: var(--danger-soft); }
.error-text { color: var(--danger); font-size: .85rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.inline-form { display: flex; gap: .6rem; max-width: 460px; } .inline-form select { flex: 1; }

/* Flash + alerts */
.flash { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid; }
.flash-success { background: var(--ok-soft); border-color: #bfe5d0; color: var(--ok); }
.flash-error { background: var(--danger-soft); border-color: #f4c3c7; color: var(--danger); }
.flash-info { background: var(--primary-soft); border-color: #d2d7f7; color: var(--primary-dark); }
.alert { border-radius: var(--radius); padding: 1.1rem 1.25rem; margin-bottom: 1.25rem; border: 2px solid; }
.alert h2 { margin-bottom: .35rem; font-size: 1.25rem; }
.alert-danger { background: var(--danger-soft); border-color: var(--danger); } .alert-danger h2 { color: var(--danger); }
.alert-warn { background: var(--warn-soft); border-color: #e8b76a; } .alert-warn h2 { color: var(--warn); }
.dup-item { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: .9rem 1rem; margin-top: .75rem; }
.live-dup { border: 2px solid #e8b76a; background: var(--warn-soft); border-radius: 8px; padding: .75rem 1rem; margin-bottom: 1rem; }
.live-dup.exact { border-color: var(--danger); background: var(--danger-soft); }
.live-dup ul { margin: .4rem 0 0; padding-left: 1.1rem; }

/* Key/value */
.kv { display: grid; grid-template-columns: 170px 1fr; gap: .45rem 1rem; margin: 0 0 .75rem; }
.kv dt { color: var(--muted); font-size: .88rem; } .kv dd { margin: 0; word-break: break-word; }

/* Dashboard */
.searchbar { display: flex; gap: .6rem; margin-bottom: 1.25rem; }
.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: .9rem; margin-bottom: 1.25rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem;
  display: flex; flex-direction: column; box-shadow: var(--shadow); color: var(--text); }
.stat:hover { text-decoration: none; border-color: var(--primary); }
.stat-num { font-size: 2rem; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; } .stat-label { color: var(--muted); font-size: .88rem; }
.stat-accent { background: var(--navy); border-color: var(--navy); }
.stat-accent .stat-num, .stat-accent .stat-label { color: #fff; }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600;
  padding: .6rem .7rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: .7rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; } .table tbody tr:hover { background: #f8faff; }
.row-muted { opacity: .6; } .row-actions { white-space: nowrap; text-align: right; }
.filters .filter-row { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: .6rem; }
.filters .filter-row > * { width: auto; flex: 1 1 150px; } .filters .grow { flex: 3 1 280px; }
.filters .btn { flex: 0 0 auto; }
details summary { cursor: pointer; color: var(--primary-dark); font-weight: 600; font-size: .9rem; margin: .25rem 0 .6rem; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 1rem; }

/* Badges */
.badge { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 600;
  background: var(--bg); color: var(--muted); }
.badge-new { background: #e7f0ff; color: #1f55b8; } .badge-contacted { background: var(--warn-soft); color: var(--warn); }
.badge-replied { background: #f1e8ff; color: #6b3fc2; } .badge-won, .badge-converted { background: var(--ok-soft); color: var(--ok); }
.badge-follow-up { background: #ffeede; color: #b4500a; } .badge-meeting { background: #dff4f8; color: #0e6f80; }
.badge-proposal { background: #e9ecff; color: #3b4cca; } .badge-negotiation { background: #fbe8f6; color: #a1209a; }
.badge-lost { background: #eceef2; color: #6b7487; }
.badge-negative { background: #fde7e4; color: #912018; }

/* Responsive */
@media (max-width: 900px) { .stats { grid-template-columns: repeat(3, 1fr); } .top-search { max-width: none; } }
@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 30; transform: translateX(-105%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  .sidebar.open { transform: none; }
  .topbar { padding: .6rem 1rem; } .top-add span { display: none; } .top-add { padding: .5rem .7rem; }
  .container { padding: 1.1rem 1rem 5rem; }
  .fab { display: grid; place-items: center; position: fixed; right: 16px; bottom: 18px; width: 54px; height: 54px; border-radius: 50%;
    background: var(--primary); color: #fff; box-shadow: 0 8px 20px rgba(0,0,0,.28); z-index: 9; }
  .fab .ico { width: 24px; height: 24px; stroke-width: 2.4; } .fab:hover { text-decoration: none; }
  .grid-2 { grid-template-columns: 1fr; } .kv { grid-template-columns: 1fr; gap: 0; } .kv dd { margin-bottom: .6rem; }
  .stats { grid-template-columns: repeat(2, 1fr); } .searchbar { flex-direction: column; }
  /* tables become stacked cards */
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border: 1px solid var(--border); border-radius: 8px; margin-bottom: .75rem; padding: .35rem .5rem; }
  .table td { border: 0; padding: .3rem .4rem; display: flex; justify-content: space-between; gap: 1rem; text-align: right; }
  .table td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; text-align: left; }
  .row-actions { justify-content: flex-end; }
}

.activity-form { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: .5rem; }
.activity-form .grow { flex: 1; min-width: 200px; }
.timeline { list-style: none; margin: 1rem 0 0; padding: 0; border-left: 2px solid var(--border); }
.timeline li { padding: 0 0 1rem 1rem; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: .35rem; width: 10px; height: 10px; border-radius: 50%; background: var(--border); }

.form-section { font-size: 1rem; margin: 1.4rem 0 .6rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.badge-prio-hot { background: var(--danger-soft); color: var(--danger); }
.badge-prio-warm { background: var(--warn-soft); color: var(--warn); }
.badge-prio-cold { background: #e7f0ff; color: #2456b8; }
.badge-due { background: var(--danger-soft); color: var(--danger); }
.due-text { color: var(--danger); font-weight: 600; }
.stat-alert .stat-num { color: var(--danger); }
.card-alert { border-left: 4px solid var(--danger); }

/* Phase 1: pipeline, follow-ups, tasks, bell */
.badge-soft { background: var(--primary-soft); color: var(--primary-dark); }
.badge-region { background: #eef6e6; color: #3b6b12; }
.badge-fu-pending { background: var(--warn-soft); color: var(--warn); }
.badge-fu-overdue { background: var(--danger-soft); color: var(--danger); }
.badge-fu-completed { background: var(--ok-soft); color: var(--ok); }
.bell-count { position: absolute; top: -6px; right: -6px; border: 2px solid var(--surface); background: var(--danger); color: #fff; font-size: .65rem; font-weight: 700;
  min-width: 17px; height: 17px; border-radius: 9px; display: inline-grid; place-items: center; padding: 0 4px; }
.bell-count[hidden] { display: none; }
.stats-pipeline { grid-template-columns: repeat(6, 1fr); }
.stats-fu { grid-template-columns: repeat(4, 1fr); }
.stat-label small { color: var(--muted); }
.tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tab { padding: .4rem .9rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.tab:hover { text-decoration: none; border-color: var(--primary); }
.tab.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.tab-count { background: rgba(0,0,0,.12); border-radius: 999px; padding: 0 .45rem; font-size: .75rem; }
ul.plain { list-style: none; margin: 0; padding: 0; } ul.plain li { padding: .5rem 0; border-bottom: 1px solid var(--border); }
ul.plain li:last-child { border-bottom: 0; }
.sub { font-size: .98rem; margin: 1.2rem 0 .5rem; }
.fu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; margin-bottom: .8rem; }
.fu { border: 1px solid var(--border); border-radius: 8px; padding: .75rem; background: #fcfcfe; }
.fu-overdue { border-color: var(--danger); background: var(--danger-soft); } .fu-completed { background: var(--ok-soft); border-color: #bfe5d0; }
.fu-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .4rem; }
.fu-form { display: flex; flex-direction: column; gap: .4rem; } .fu-row { display: flex; gap: .4rem; }
.fu-actions { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .5rem; }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: .8rem; overflow-x: auto; padding-bottom: 1rem; align-items: start; }
.kcol { background: #e9edf5; border-radius: var(--radius); padding: .6rem; min-height: 200px; }
.khead { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }
.kbody { display: flex; flex-direction: column; gap: .5rem; min-height: 120px; }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: .6rem .7rem; box-shadow: var(--shadow); cursor: grab; }
.kcard-locked { cursor: default; opacity: .85; } .kcard.dragging { opacity: .4; }
.kcol.drag-over { outline: 2px dashed var(--primary); }
.kmeta { display: flex; gap: .5rem; align-items: center; margin-top: .3rem; }
@media (max-width: 900px) { .stats-pipeline, .stats-fu { grid-template-columns: repeat(2, 1fr); } .fu-grid { grid-template-columns: 1fr; } }

/* Option 1 polish */
.sidebar .side-out { width: 100%; background: transparent; color: var(--navy-text); border-color: rgba(255,255,255,.22); }
.sidebar .side-out:hover { background: rgba(255,255,255,.1); color: #fff; }
.sidebar .brand { font-size: .98rem; white-space: nowrap; }
.shell .searchbar { display: none; }   /* the top bar already has a global search */

/* Option 1 polish: remaining screens */
.alert { box-shadow: var(--shadow); display: block; }
.alert h2::before { content: "\26A0"; margin-right: .5rem; }
.alert-danger { border-width: 2px; } .alert-danger h2 { font-size: 1.35rem; }
.dup-item { border-radius: var(--radius); border-color: #f3c0bb; }
.alert-warn .dup-item { border-color: #ecd1a0; }
.table tbody tr:has(.due-text) td { background: #fff7f6; }
.table tbody tr:has(.due-text) td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.card { border-radius: 12px; }
.stat { border-radius: 12px; padding: 1.1rem 1.15rem; }
.stats-fu .stat { padding: 1.25rem; }
.stat-alert { border-color: #f3c0bb; background: #fffafa; }
.page-head h1 + p, .page-head p { color: var(--muted); }
input, select, textarea { border-radius: 8px; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(29,95,209,.15); }
.has-error input, .has-error select { border-color: var(--danger); background: var(--danger-soft); }
.form-section { color: var(--navy); }
.live-dup.exact { border-width: 2px; }
.kv { grid-template-columns: 190px 1fr; }
.timeline li::before { background: var(--primary); }
.fu { background: #fff; }
.tab.active { background: var(--navy); border-color: var(--navy); }
.kanban .kcol { background: #e9eef6; }
.kcard { border-radius: 10px; }
.btn { border-radius: 8px; }
.btn-secondary { background: var(--primary-soft); color: var(--primary-dark); }

/* ---- Import (Phase 2) ---- */
.steps { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.step { display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .8rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-size: .88rem; }
.step b { display: inline-grid; place-items: center; width: 1.35rem; height: 1.35rem; border-radius: 50%; background: #e6ebf3; color: var(--muted); font-size: .78rem; }
.step.active { border-color: var(--primary); color: var(--primary-dark); font-weight: 600; }
.step.active b { background: var(--primary); color: #fff; }
.step.done b { background: var(--ok); color: #fff; }
.import-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: .5rem; }
.import-rules .plain-list { margin: 0; padding-left: 1.2rem; line-height: 1.7; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.card-head h2 { margin: 0; }
.stats-import { grid-template-columns: repeat(4, 1fr); }
.stats-import5 { grid-template-columns: repeat(5, 1fr); }
.stat-ok .stat-num { color: var(--ok); } .stat-warn .stat-num { color: var(--warn); }
.map-table select { width: 100%; min-width: 12rem; }
.check { display: flex; gap: .55rem; align-items: flex-start; font-size: .92rem; margin-top: .4rem; }
.check input { margin-top: .25rem; }
.import-details div { margin-bottom: .15rem; }
.import-go p { margin: 0 0 .75rem; }
.btn.is-busy { opacity: .7; pointer-events: none; }
@media (max-width: 900px) { .stats-import, .stats-import5 { grid-template-columns: repeat(2, 1fr); } }
.check { justify-content: flex-start; }
.check input[type=checkbox] { width: auto; flex: none; }
@media (max-width: 760px) {
  .table td.import-details { display: block; text-align: left; }
  .table td.import-details::before { display: block; margin-bottom: .25rem; }
}

/* ---- Bell notifications ---- */
.bell-wrap { position: relative; }
.bell-panel { position: absolute; right: 0; top: calc(100% + .5rem); width: 380px; max-width: calc(100vw - 1.5rem); max-height: 70vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(13,33,66,.18); z-index: 60; }
.bell-panel[hidden] { display: none; }
.np-head { display: flex; align-items: center; gap: .6rem; padding: .8rem 1rem; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); }
.np-readall { margin-left: auto; }
.btn-link { background: none; border: 0; color: var(--primary); font: inherit; font-size: .85rem; cursor: pointer; padding: 0; }
.btn-link:disabled { color: var(--muted); cursor: default; }
.np-empty { padding: 1.2rem 1rem; margin: 0; }
.np-foot, .np-tasks { display: block; text-align: center; padding: .7rem 1rem; border-top: 1px solid var(--border); font-weight: 600; font-size: .9rem; }
.np-tasks { background: var(--warn-soft); color: var(--warn); }
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif { display: flex; gap: .75rem; align-items: flex-start; padding: .8rem 1rem; border-bottom: 1px solid var(--border); position: relative; }
.notif:last-child { border-bottom: 0; }
.notif.is-unread { background: #f3f7ff; }
.notif.is-done .notif-body { opacity: .65; }
.notif-dot { flex: none; width: .65rem; height: .65rem; border-radius: 50%; margin-top: .4rem; }
.dot-red { background: var(--danger); } .dot-amber { background: #e8890c; } .dot-blue { background: var(--primary); } .dot-green { background: var(--ok); }
.notif-body { display: flex; flex-direction: column; gap: .15rem; flex: 1; min-width: 0; color: var(--text); }
.notif-body:hover { text-decoration: none; }
.notif-title { font-weight: 700; }
.notif.is-read .notif-title { font-weight: 600; }
.notif-lead { font-weight: 500; overflow-wrap: anywhere; }
.notif-meta { display: flex; flex-wrap: wrap; gap: .1rem .9rem; color: var(--muted); font-size: .84rem; }
.notif-when { font-weight: 600; color: var(--text); }
.notif-new { background: var(--primary); color: #fff; border-radius: 999px; font-size: .65rem; padding: .05rem .45rem; margin-left: .3rem; vertical-align: middle; }
.notif-note { color: var(--muted); font-weight: 400; font-size: .78rem; margin-left: .3rem; }
.notif-note-line { color: var(--muted); font-size: .84rem; font-style: italic; }
.notif-act { flex: none; }
.notif-compact .notif { padding: .65rem 1rem; }
@media (max-width: 760px) {
  .bell-wrap { position: static; }
  .bell-panel { position: fixed; left: .75rem; right: .75rem; top: 4rem; width: auto; max-width: none; max-height: 75vh; }
  .notif { flex-wrap: wrap; } .notif-act { margin-left: 1.4rem; }
}

/* ---- Browser notifications ---- */
.push-banner { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; background: #eef4ff; border: 1px solid #cfe0ff; border-left: 4px solid var(--primary);
  border-radius: 12px; padding: .8rem 1rem; margin-bottom: 1rem; }
.push-banner[hidden] { display: none; }
.push-banner-ico { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--primary); color: #fff; flex: none; }
.push-banner-ico .ico { width: 1.15rem; height: 1.15rem; stroke: #fff; }
.push-banner-text { flex: 1; min-width: 14rem; display: flex; flex-direction: column; gap: .1rem; font-size: .92rem; }
.push-banner-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.push-status { margin: .2rem 0 .8rem; padding: .7rem .9rem; border-radius: 10px; background: var(--bg, #f5f7fb); border: 1px solid var(--border); }
.push-status[data-state="ready"] { background: var(--ok-soft); border-color: #bfe5d0; color: var(--ok); }
.push-status[data-state="denied"] { background: var(--danger-soft); border-color: #f4c3c7; color: var(--danger); }
.push-status[data-state="default"], .push-status[data-state="off"] { background: var(--warn-soft); border-color: #ecd1a0; color: var(--warn); }
.push-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: .6rem; }
.push-actions [hidden] { display: none; }
.push-form { border-top: 1px solid var(--border); padding-top: .8rem; margin-top: .4rem; }
.switch-row { display: flex; gap: .7rem; align-items: flex-start; padding: .45rem 0; cursor: pointer; }
.switch-row input[type=checkbox] { width: 1.15rem; height: 1.15rem; margin-top: .2rem; flex: none; accent-color: var(--primary); }
.switch-row span { display: flex; flex-direction: column; gap: .1rem; }
.push-scope { max-width: 24rem; margin-top: .4rem; }
.push-note { margin: .8rem 0 0; }
[hidden] { display: none !important; }

/* category list in the left menu */
.side-cats { display: flex; flex-direction: column; gap: 1px; }
.side-nav .side-cats a { justify-content: space-between; padding: .38rem .7rem; font-size: .88rem; }
.side-cats .cat-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-cats .cat-n { background: rgba(255,255,255,.12); border-radius: 999px; padding: 0 .5rem; font-size: .75rem; font-weight: 700; min-width: 1.6rem; text-align: center; }
.side-cats a.zero { opacity: .5; }
.side-cats a.active .cat-n { background: rgba(255,255,255,.28); }
.badge-cat { background: #e9eefb; color: #1f3b7a; }
.cat-chip { margin: 0 0 .75rem; } .cat-chip a { margin-left: .5rem; font-size: .85rem; }
.dup-owner { margin: .2rem 0; }

/* ---- Executive dashboard (v10): app blue + navy, flat cards, big readable numbers ---- */
.dx-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.3rem; }
.dx-head h1 { font-size: 2rem; font-weight: 700; letter-spacing: -.025em; line-height: 1.15; margin: 0; }
.dx-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.dx-tile, .dx-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); }
.dx-tile { padding: 20px 22px; display: flex; flex-direction: column; color: var(--text); border-top: 4px solid var(--primary); transition: box-shadow .15s, transform .15s; }
.dx-tile:hover { text-decoration: none; box-shadow: 0 2px 4px rgba(16,24,40,.06), 0 12px 28px rgba(16,24,40,.10); transform: translateY(-1px); }
.dx-tile:nth-child(3) { border-top-color: var(--warn); } .dx-tile:nth-child(4) { border-top-color: var(--ok); }
.dx-tile b { font-size: 2.6rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.dx-tile span { margin-top: 6px; font-weight: 600; font-size: .98rem; } .dx-tile small { color: var(--muted); font-size: .88rem; margin-top: 2px; }
.dx-tile.bad { background: #fff6f5; border-top-color: var(--danger); } .dx-tile.bad b { color: var(--danger); }
.dx-row { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; margin-bottom: 18px; }
.dx-a7 { grid-column: span 7; min-width: 0; } .dx-a5 { grid-column: span 5; min-width: 0; }
.dx-card { padding: 22px 24px; }
.dx-card h2 { display: flex; justify-content: space-between; align-items: baseline; font-size: 1.05rem; font-weight: 700; margin-bottom: 14px; }
.dx-card h2 a { font-size: .88rem; font-weight: 600; }
.dx-sub { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 18px 0 6px; }
.dx-fu, .dx-leg, .dx-cats, .dx-tasks { list-style: none; margin: 0; padding: 0; }
.dx-fu li { display: grid; grid-template-columns: 5px 1fr auto auto; gap: 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); }
.dx-fu li:first-child { border-top: 0; }
.dx-stripe { height: 38px; border-radius: 4px; background: var(--ok); } .over .dx-stripe { background: var(--danger); } .today .dx-stripe { background: #d48a1c; }
.dx-who strong { display: block; color: var(--text); font-size: 1rem; } .dx-who small, .dx-table small { display: block; color: var(--muted); font-size: .86rem; }
.dx-when { font-size: .9rem; color: var(--muted); text-align: right; } .dx-when b { color: var(--ok); } .over .dx-when b { color: var(--danger); } .today .dx-when b { color: var(--warn); }
.dx-tasks li { padding: 7px 0; border-top: 1px solid var(--border); }
.dx-pipe { width: 100%; height: 20px; display: block; border-radius: 99px; margin: 4px 0 16px; overflow: hidden; }
.dx-leg { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 22px; }
.dx-leg a { display: flex; align-items: center; gap: 9px; color: var(--text); padding: 6px 0; cursor: pointer; } .dx-leg a:hover { text-decoration: none; color: var(--primary); } .dx-leg b { margin-left: auto; font-variant-numeric: tabular-nums; }
.dx-dot { width: 11px; height: 11px; flex: none; }
.dx-chart { border-bottom: 1px solid var(--border); padding-bottom: 6px; margin-bottom: 10px; } .dx-iso { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.dx-cats a { display: grid; grid-template-columns: 1fr 90px 34px 40px; gap: 10px; align-items: center; padding: 7px 6px; border-radius: 8px; color: var(--text); cursor: pointer; } .dx-cats a:hover { text-decoration: none; background: var(--primary-soft); }
.dx-cats .bar { width: 100%; height: 8px; } .dx-cats b { text-align: right; font-variant-numeric: tabular-nums; } .dx-cats em { font-style: normal; color: var(--muted); font-size: .85rem; text-align: right; }
.dx a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
@media (max-width: 1100px) { .dx-a7, .dx-a5 { grid-column: span 12; } }
@media (max-width: 820px) { .dx-kpis { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) {
  .dx-head h1 { font-size: 1.6rem; } .dx-tile b { font-size: 2.2rem; } .dx-card { padding: 18px 16px; }
  .dx-fu li { grid-template-columns: 5px 1fr; } .dx-when, .dx-fu .btn { grid-column: 2; text-align: left; justify-self: start; }
  .dx-fu .btn { min-height: 44px; display: inline-flex; align-items: center; }
  .dx-leg { grid-template-columns: 1fr; } .dx-cats a { grid-template-columns: 1fr 60px 30px; } .dx-cats em { display: none; }
}
@media (prefers-reduced-motion: reduce) { .dx-tile { transition: none; } .dx-tile:hover { transform: none; } }

/* ---- Premium sidebar (v10): same navy + blue as the dashboard ---- */
.sidebar { background: linear-gradient(180deg, #0f2447 0%, #0a1830 100%); width: 252px; padding: 20px 14px; border-right: 1px solid #071022; }
.sidebar .brand { padding: 4px 10px 22px; font-size: 1.08rem; font-weight: 700; letter-spacing: -.01em; }
.sidebar .brand-mark { background: linear-gradient(145deg, #6d9bf2, #1d5fd1); box-shadow: 0 4px 12px rgba(29,95,209,.45); border-radius: 10px; width: 32px; height: 32px; }
.side-sec { color: #7f93b3; opacity: 1; font-size: .66rem; letter-spacing: .14em; padding: 20px 12px 8px; }
.side-nav a { color: #b6c4dc; padding: .62rem .8rem; border-radius: 10px; position: relative; transition: background .15s, color .15s; cursor: pointer; }
.side-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-nav a.active { background: rgba(91,141,239,.18); color: #fff; font-weight: 600; }
.side-nav a.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: #6d9bf2; }
.side-nav a.active .ico { color: #8fb4f7; }
.side-nav a:focus-visible { outline: 2px solid #8fb4f7; outline-offset: -2px; }
.side-cats a { padding: .42rem .8rem; font-size: .9rem; gap: .65rem; }
.side-cats .cat-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.cd0 { background: #5b8def; } .cd1 { background: #34b38a; } .cd2 { background: #f2b24c; } .cd3 { background: #8b9fc4; } .cd4 { background: #6d9bf2; } .cd5 { background: #4a6fa5; }
.side-cats .cat-n { background: rgba(255,255,255,.09); color: #dbe5f5; border-radius: 99px; padding: 0 .55rem; font-size: .76rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.side-cats a.active .cat-n { background: #5b8def; color: #fff; }
.side-user { border-top: 1px solid rgba(255,255,255,.1); }
.avatar { background: linear-gradient(145deg, #6d9bf2, #1d5fd1); }
.side-out { border-color: rgba(255,255,255,.16); }

/* ---- Lists (v11) ---- */
.bulk-bar { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .55rem .8rem; margin-bottom: .6rem; background: var(--primary-soft); border: 1px solid #cddcf6; border-radius: 10px; }
.bulk-bar select { min-width: 220px; } .bulk-count { font-weight: 600; color: var(--primary-dark); min-width: 90px; }
.bulk-bar:not(.has-selection) select { opacity: .6; }
.chk { width: 34px; } .chk input { width: 17px; height: 17px; cursor: pointer; }
.badge-list { background: #e5f6ee; color: var(--ok); } .badge-list:hover { text-decoration: none; filter: brightness(.96); }
.side-newlist { margin-top: 4px; border: 1px dashed rgba(255,255,255,.22); color: #8fb4f7 !important; }
.side-newlist .cat-plus { width: 9px; text-align: center; font-weight: 700; }
.side-newlist.active, .side-newlist:hover { border-color: #8fb4f7; }
@media (max-width: 760px) { .chk { width: auto; } }
.list-actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.inline-form .btn { white-space: nowrap; } .list-actions .inline-form input { min-width: 180px; }
.bulk-bar select { flex: 0 1 300px; width: auto; }
.table td[data-label="Phone"] { white-space: nowrap; }

/* ---- Categories with their projects inside (v12) ---- */
.side-cats .side-cat { margin-top: 2px; font-weight: 600; }
.side-cats .side-cat-plain { display: flex; align-items: center; gap: .65rem; padding: .42rem .8rem; color: #8ea2c4; font-size: .84rem; margin-top: 6px; }
.side-cats .side-proj { padding: .28rem .8rem .28rem 2.2rem; font-size: .86rem; font-weight: 400; color: #a9b9d3; }
.proj-tick { width: 7px; height: 7px; border-left: 2px solid #4a6a9a; border-bottom: 2px solid #4a6a9a; border-radius: 0 0 0 4px; margin-top: -4px; flex: none; }
.side-cats .side-proj.active { background: rgba(91,141,239,.22); color: #fff; }
.side-cats .side-proj .cat-n { background: transparent; color: #9fb2d1; padding: 0 .3rem; }
.stack-form { display: flex; flex-direction: column; gap: .6rem; max-width: 460px; }
.cat-manage li { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .35rem 0; border-top: 1px solid var(--border); }
.dx-sub-gap { margin: 14px 0 4px; }
.list-actions .inline-form { max-width: none; } .list-actions .inline-form select { flex: 0 0 170px; width: 170px; }

/* ---- Bulk delete (v14) ---- */
.bulk-bar .btn-danger[disabled] { opacity: .45; cursor: not-allowed; }
.del-panel { margin: 0 0 .8rem; border: 1px solid #f1c9c9; background: #fff7f7; border-radius: 10px; padding: .5rem .8rem; }
.del-panel summary { cursor: pointer; font-weight: 600; color: #b42318; }
.del-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .8rem; margin: .7rem 0; }
.del-card { display: flex; flex-direction: column; gap: .45rem; background: #fff; border: 1px solid #f1c9c9; border-radius: 10px; padding: .8rem; align-items: flex-start; }
.del-card input[type=text] { width: 9rem; margin-left: .3rem; }

/* ---- Email tracking (v16) ---- */
.side-nav a { display: flex; align-items: center; }
.nav-pill { margin-left: auto; background: rgba(255,255,255,.14); border-radius: 999px; padding: 0 .5rem; font-size: .75rem; font-weight: 700; min-width: 1.6rem; text-align: center; }
.badge-emailed { background: #e5f6ee; color: var(--ok); }
.badge-notemailed { background: #eef1f6; color: #5b6b86; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; font: inherit; font-size: .8rem; }
.linkbtn:hover { text-decoration: underline; }
.mini-date { display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; color: #475569; white-space: nowrap; }
.mini-date input { width: auto; padding: .3rem .4rem; }
.bulk-sep { width: 1px; align-self: stretch; background: #cddcf6; margin: 0 .2rem; }
.quick-chips { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .2rem 0 .8rem; }
.qchip { display: inline-flex; gap: .4rem; align-items: center; padding: .35rem .8rem; border-radius: 999px; background: #fff; border: 1px solid #cddcf6; color: var(--primary-dark); font-size: .85rem; font-weight: 600; }
.qchip b { background: var(--primary-soft); border-radius: 999px; padding: 0 .45rem; }
.qchip:hover { text-decoration: none; border-color: var(--primary); }
.qchip.on { background: var(--primary); color: #fff; border-color: var(--primary); } .qchip.on b { background: rgba(255,255,255,.25); color: #fff; }
.email-card { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; padding: .7rem 1rem; }
.email-card .inline-form { display: flex; gap: .5rem; align-items: center; }
.table td[data-label="Emailed"] { white-space: nowrap; } .table td[data-label="Emailed"] .badge { white-space: nowrap; }
.table td[data-label="Emailed"] form.inline { display: block; margin-top: .2rem; }
.table td[data-label="Added"] { white-space: nowrap; }

.rename-bar { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: 0 0 .8rem; }
.rename-bar input[type=text] { min-width: 240px; }

/* ---- Leads table that fits the screen: no sideways scrolling (v19) ---- */
.table-leads { table-layout: auto; font-size: .86rem; }
.table-leads th { padding: .55rem .45rem; font-size: .7rem; white-space: nowrap; }
.table-leads td { padding: .6rem .4rem; vertical-align: top; }
.table-leads td[data-label="Company"], .table-leads td[data-label="Contact"], .table-leads td[data-label="Owner"] { overflow-wrap: anywhere; }
.table-leads td.wrap-any { overflow-wrap: anywhere; word-break: break-word; min-width: 130px; }
.table-leads td[data-label="Company"] { min-width: 130px; }
.table-leads td[data-label="Phone"] { white-space: normal; }
.table-leads .badge { white-space: nowrap; }
.table-leads td[data-label="List"] .badge { white-space: normal; text-align: left; }
.table-leads td[data-label="Owner"] { max-width: 90px; }
.table-leads td[data-label="Company"] { max-width: 190px; }
.table-leads td[data-label="Emailed"], .table-leads td[data-label="Dates"] { white-space: nowrap; }
.table-leads td[data-label="Stage"], .table-leads td[data-label="Follow-up"] { white-space: nowrap; }
.table-leads .row-actions { text-align: right; }
.table-leads .btn-sm { padding: .25rem .5rem; font-size: .75rem; }
.card:has(.table-leads) .table-wrap { overflow-x: visible; }
@media (max-width: 1500px) { .table-leads td[data-label="Dates"] .small { font-size: .76rem; } }
@media (max-width: 1440px) {
  .table-leads { font-size: .8rem; }
  .table-leads th { padding: .5rem .3rem; font-size: .66rem; letter-spacing: .02em; }
  .table-leads td { padding: .5rem .3rem; }
  .table-leads td.wrap-any, .table-leads td[data-label="Company"] { min-width: 105px; }
  .table-leads td[data-label="Emailed"], .table-leads td[data-label="Follow-up"], .table-leads td[data-label="Stage"] { white-space: normal; }
  .table-leads td[data-label="Stage"] .badge, .table-leads td[data-label="Emailed"] .badge { white-space: nowrap; font-size: .72rem; padding: .15rem .45rem; }
  .table-leads .chk { width: 22px; }
}

/* ---- numbered pages + return to the same spot (v20) ---- */
.pager-nums { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; justify-content: center; }
.pg { min-width: 2rem; height: 2rem; padding: 0 .5rem; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid var(--border); background: #fff; color: var(--primary-dark); font-weight: 600; font-size: .85rem; }
a.pg:hover { text-decoration: none; border-color: var(--primary); background: var(--primary-soft); }
.pg-on { background: var(--primary); border-color: var(--primary); color: #fff; }
.pg-gap { color: var(--muted); padding: 0 .2rem; }
tr[id^="lead-"] { scroll-margin-top: 90px; }
tr[id^="lead-"]:target td { background: #fff8dc !important; }

.pager-of { white-space: nowrap; }

/* ---- Templates, PDFs, Hot/Warm/Cold, note name (v22) ---- */
.tpl-item, .file-item { border: 1px solid var(--border); border-radius: 10px; padding: .75rem .9rem; margin-bottom: .7rem; background: #fff; }
.tpl-head, .file-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.file-head > div { flex: 1; min-width: 160px; }
.tpl-body { margin-top: .4rem; padding: .6rem; background: #f6f8fc; border-radius: 8px; max-height: 260px; overflow: auto; }
.tpl-actions, .file-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-top: .6rem; }
.file-ico { width: 38px; height: 38px; border-radius: 8px; background: #fde8e8; color: #b42318; font-weight: 800; font-size: .7rem; display: inline-flex; align-items: center; justify-content: center; }
.share-box { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-top: .6rem; padding: .6rem; background: var(--primary-soft); border-radius: 10px; }
.share-box input { flex: 1; min-width: 220px; }
.composer input[type=text], .composer textarea { width: 100%; margin-top: .5rem; }
.note-title { max-width: 220px; }
.temp-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .7rem; margin-bottom: .9rem; }
.temp-tab { display: flex; flex-direction: column; gap: .15rem; padding: .8rem 1rem; background: #fff; border: 2px solid var(--border); border-radius: 12px; color: inherit; }
.temp-tab:hover { text-decoration: none; border-color: var(--primary); }
.temp-tab strong { font-size: 1.05rem; } .temp-n { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.temp-tab.on.temp-hot { border-color: #e5484d; background: #fff3f3; } .temp-tab.on.temp-warm { border-color: #f2a33a; background: #fff9ee; } .temp-tab.on.temp-cold { border-color: #4a86e8; background: #f0f6ff; }
.temp-btn-hot { color: #b42318; } .temp-btn-warm { color: #b25e00; } .temp-btn-cold { color: #1f55b8; }

/* ---- Daily work (v24) ---- */
.day-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .7rem; margin: .4rem 0 1rem; }
.day-tile { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: .8rem 1rem; display: flex; flex-direction: column; gap: .1rem; }
.day-tile span { font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.day-tile b { font-size: 2rem; line-height: 1.1; color: var(--primary-dark); }
.day-tile small { color: var(--muted); }
.day-table th.grp { text-align: center; border-bottom: 1px solid var(--border); }
.day-table td, .day-table th { text-align: center; } .day-table td:first-child, .day-table th:first-child { text-align: left; }
.day-table tr.day-on td { background: #eef4ff; }
.day-list { list-style: none; padding: 0; margin: 0 0 .8rem; } .day-list li { padding: .4rem 0; border-bottom: 1px solid var(--border); }
.dx-today { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; align-items: center; padding: .7rem 1rem; margin: 0 0 1rem; background: #fff; border: 1px solid #cddcf6; border-left: 4px solid var(--primary); border-radius: 12px; color: inherit; }
.dx-today:hover { text-decoration: none; border-color: var(--primary); }
.dx-today b { color: var(--primary-dark); font-size: 1.1rem; } .dx-today em { margin-left: auto; color: var(--primary); font-style: normal; font-weight: 600; }

/* ---- Word-style notes (v25) ---- */
.rt { border: 1px solid var(--border, #d5dbe6); border-radius: 10px; background: #fff; overflow: hidden; }
.rt-bar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 8px; background: #f4f6fa; border-bottom: 1px solid #d5dbe6; align-items: center; }
.rt-bar button, .rt-bar select { border: 1px solid transparent; background: transparent; border-radius: 6px; min-width: 32px; height: 32px; font: 600 .85rem inherit; color: #2b3a55; cursor: pointer; padding: 0 8px; }
.rt-bar button:hover { background: #e3e9f4; }
.rt-bar button.on { background: #dbe5fb; border-color: #b6c8f5; }
.rt-bar i { width: 1px; height: 20px; background: #d5dbe6; margin: 0 4px; }
.rt-body { min-height: 230px; padding: 14px 16px; font-size: .95rem; line-height: 1.6; outline: none; }
.rt-body:empty::before { content: attr(data-placeholder); color: #8a94a6; }
.rt-body h3, .rt-view h3 { margin: .2em 0; }
.rt-body ul, .rt-body ol, .rt-view ul, .rt-view ol { margin: .3em 0 .3em 1.3em; }
.rt-view p { margin: .3em 0; }

/* ---- Bounced emails in red (v26) ---- */
.badge-bounced { background: #fde8ea; color: #c0152b; border: 1px solid #f4a9b1; font-weight: 700; }
.bounce-text { color: #c0152b; }
.bounce-link { color: #c0152b; }
.qchip-red { border-color: #f4a9b1; color: #c0152b; }
.qchip-red b { background: #fde8ea; color: #c0152b; }
.qchip-red.on { background: #fde8ea; border-color: #c0152b; }
.btn-danger-soft { background: #fde8ea; color: #c0152b; border-color: #f4a9b1; }
.btn-danger-soft:hover { background: #fbd3d8; }
.btn-danger-soft[disabled] { opacity: .45; cursor: not-allowed; }
.bounce-banner { background: #fde8ea; border: 1px solid #f4a9b1; border-left: 5px solid #c0152b; color: #8f0f20; border-radius: 10px; padding: .7rem 1rem; margin-bottom: 1rem; display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.nav-bounce .nav-pill-red { background: #c0152b; color: #fff; }
tr.row-bounced td:first-of-type { box-shadow: inset 4px 0 0 #c0152b; }
.qchip.qchip-red.on { background: #c0152b; border-color: #c0152b; color: #fff; }
.qchip.qchip-red.on b { background: #fff; color: #c0152b; }

/* ---- Priority reminders on the dashboard (v27) ---- */
.dx-priority { background: #fff; border: 1px solid #f4c3c7; border-left: 6px solid #d92d20; border-radius: 12px; padding: .9rem 1.1rem; margin-bottom: 1.1rem; box-shadow: 0 1px 3px rgba(16,24,40,.06); }
.dx-priority h2 { font-size: 1.05rem; margin: 0 0 .6rem; display: flex; flex-wrap: wrap; gap: .6rem; align-items: baseline; color: #b42318; }
.dx-priority h2 small { color: var(--muted); font-weight: 400; font-size: .8rem; }
.dx-priority h2 a { margin-left: auto; font-size: .82rem; font-weight: 600; }
.dx-pcount { background: #d92d20; color: #fff; border-radius: 999px; padding: 0 .55rem; font-size: .82rem; }
.dx-priority ul { list-style: none; margin: 0; padding: 0; }
.dx-priority li { display: flex; flex-wrap: wrap; gap: .6rem .9rem; align-items: center; padding: .55rem .2rem; border-top: 1px solid #f1e3e4; }
.dx-priority li:first-child { border-top: 0; }
.dx-priority li.hot { background: #fff6f6; }
.pq-who { flex: 1 1 220px; min-width: 0; }
.pq-who small { display: block; color: var(--muted); }
.pq-when { font-size: .85rem; font-weight: 600; color: #475467; white-space: nowrap; }
li.late .pq-when { color: #d92d20; }
.pq-phone { font-size: .85rem; white-space: nowrap; }
.badge-prio-hot { background: #fde8ea; color: #c0152b; border: 1px solid #f4a9b1; font-weight: 700; }
.badge-prio-warm { background: #fff1db; color: #a15c00; }
.badge-prio-cold { background: #e6f0fb; color: #2b5fa8; }
.bounce-link { color: var(--muted, #667085); font-size: .75rem; }
.bounce-link:hover { color: #c0152b; }
.setby { color: #b42318; font-weight: 600; }
.dx-bounce { background: #fff; border: 1px solid #f4a9b1; border-left: 6px solid #c0152b; border-radius: 12px; padding: .9rem 1.1rem; margin-bottom: 1.1rem; }
.dx-bounce h2 { font-size: 1.05rem; margin: 0 0 .6rem; display: flex; flex-wrap: wrap; gap: .6rem; align-items: baseline; color: #8f0f20; }
.dx-bounce h2 small { color: var(--muted); font-weight: 400; font-size: .8rem; }
.dx-bounce h2 a { margin-left: auto; font-size: .82rem; font-weight: 600; }
.dx-bounce ul { list-style: none; margin: 0; padding: 0; }
.dx-bounce li { display: flex; flex-wrap: wrap; gap: .5rem .9rem; align-items: center; padding: .5rem .2rem; border-top: 1px solid #f6dfe2; }
.dx-bounce li:first-child { border-top: 0; }
.dx-bounce .pq-when { color: #c0152b; }
.dx-priority li.pq-group { padding: .35rem .5rem; margin-top: .3rem; background: #fbeaea; border-radius: 8px; font-size: .85rem; gap: .5rem; border-top: 0; }
.dx-priority li.pq-group-reminder { background: #d92d20; color: #fff; font-size: .92rem; }
.dx-priority li.pq-group-reminder span { background: #fff; color: #d92d20; border-radius: 999px; padding: 0 .5rem; font-weight: 700; }
.dx-priority li.pq-group-followup { background: #eef2f8; color: #344054; }
.build-tag { display: block; margin-top: .5rem; color: rgba(255,255,255,.45); font-size: .7rem; }

/* ---- Reminders given per salesperson (v32) ---- */
.dx-remstats { background: #fff; border: 1px solid var(--border, #e4e7ec); border-radius: 12px; padding: .9rem 1.1rem; margin-bottom: 1.1rem; }
.dx-remstats h2 { font-size: 1.05rem; margin: 0 0 .5rem; }
.dx-remstats h2 small { color: var(--muted); font-weight: 400; font-size: .8rem; margin-left: .4rem; }

/* ---- Reminders given strip on the Leads page (v33) ---- */
.rem-strip { display: flex; flex-wrap: wrap; gap: .5rem .7rem; align-items: center; margin: 0 0 .8rem; padding: .55rem .8rem; background: #fff; border: 1px solid #e4e7ec; border-left: 5px solid #d92d20; border-radius: 10px; font-size: .85rem; }
.rem-chip { display: inline-flex; gap: .6rem; align-items: baseline; padding: .2rem .65rem; background: #f6f8fb; border-radius: 999px; color: #344054; }
.rem-chip:hover { text-decoration: none; background: #eaf0fb; }
.rem-chip > b { color: var(--primary-dark, #1a47a6); }
.rem-chip span { color: #667085; }
.rem-chip .rem-late, .rem-chip .rem-late b { color: #d92d20; }

/* ---- Reminder sheet (v35) ---- */
.sheet-wrap { overflow-x: auto; }
.sheet-table th.num, .sheet-table td.num { text-align: center; min-width: 3.2rem; }
.sheet-table td.zero { color: #c2c8d2; }
.sheet-table td.has { font-weight: 700; color: #1a47a6; background: #f1f6ff; }
.sheet-table th.is-today { color: #d92d20; }
.sheet-table .sep { border-left: 2px solid #e4e7ec; }
.sheet-table .sticky-col { position: sticky; left: 0; background: #fff; z-index: 1; min-width: 9rem; }
.sheet-table tfoot td { background: #f6f8fb; border-top: 2px solid #e4e7ec; }
.sheet-table tfoot .sticky-col { background: #f6f8fb; }
.head-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.head-actions .filter-row { display: flex; gap: .4rem; margin: 0; }
.rem-strip-focus { border-left-color: #1a47a6; background: #f4f8ff; font-size: .95rem; }
.rem-strip-focus .rem-chip { background: #fff; border: 1px solid #cddcf6; }
.sheet-filter { display: flex; flex-wrap: wrap; gap: .8rem 1.4rem; align-items: center; margin-bottom: 1rem; }
.sheet-quick { display: flex; flex-wrap: wrap; gap: .5rem; }
.sheet-custom { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-left: auto; }

/* ---- Follow-up history + results (v38) ---- */
.fh { display: flex; flex-direction: column; gap: 3px; min-width: 230px; }
.fh-top { display: flex; flex-wrap: wrap; gap: .1rem .5rem; align-items: baseline; font-size: .8rem; }
.fh-count { background: #e8efff; color: #1a47a6; border-radius: 999px; padding: 0 .55rem; font-weight: 700; white-space: nowrap; }
.fh-next { color: #667085; }
.fh-next b.late { color: #d92d20; }
.fh-next small { display: block; color: #98a2b3; }
.fh-row { display: flex; gap: .4rem; align-items: center; font-size: .78rem; white-space: nowrap; }
.fh-d { color: #475467; min-width: 3.1rem; font-weight: 600; }
.fh-k { color: #667085; min-width: 4.6rem; }
.fh-more { font-size: .75rem; color: #1a47a6; }
.o { border-radius: 999px; padding: 1px 8px; font-weight: 700; font-size: .72rem; display: inline-block; }
.o-positive { background: #e5f6ee; color: #12805c; }
.o-negative { background: #fde8ea; color: #c0152b; }
.o-noanswer, .o-sent { background: #eef1f6; color: #5b6b86; }
.o-waiting { background: #fff1db; color: #a15c00; }
.btn-outcome { background: #fff; border: 1px solid #d5dbe6; color: #344054; }
.btn-outcome-positive:hover, .btn-outcome-positive.on { background: #e5f6ee; border-color: #12805c; color: #12805c; }
.btn-outcome-negative:hover, .btn-outcome-negative.on { background: #fde8ea; border-color: #c0152b; color: #c0152b; }
.btn-outcome-noanswer:hover, .btn-outcome-noanswer.on { background: #eef1f6; border-color: #5b6b86; }
.fu-result { margin: .2rem 0; font-size: .85rem; }
.fh { min-width: 0; max-width: 215px; }
.fh-k { min-width: 4.2rem; }
.fh-row { gap: .3rem; font-size: .75rem; }
.fh-next small { white-space: normal; }
.o-sent { background: #e8efff; color: #1a47a6; }
.o-late { background: #fde8ea; color: #c0152b; }
.o-notset { background: #f2f4f7; color: #98a2b3; font-weight: 600; }
.fh-empty .fh-k { color: #98a2b3; }
.fh-sub { font-size: .7rem; color: #98a2b3; margin-left: 3.3rem; }
.fh-note { font-size: .72rem; color: #475467; margin: -1px 0 2px 3.3rem; white-space: normal; line-height: 1.25; font-style: italic; }
.fh { max-width: 235px; }

/* v41: Meta connection page */
.mt-st { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; vertical-align: middle; }
.mt-st.ok { background: #d1fadf; color: #05603a; } .mt-st.wait { background: #fef0c7; color: #93370d; } .mt-st.bad { background: #fee4e2; color: #912018; }
.mt-copy { display: flex; gap: 8px; } .mt-copy input { flex: 1; background: #f4f6fa; }
.mt-ev { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 20px; margin: .3rem 0 .8rem; }
.mt-ev label { display: flex; gap: 8px; align-items: center; justify-content: flex-start; }
.mt-gap { margin-top: 1rem; } .mt-actions { display: flex; gap: 8px; flex-wrap: wrap; } .mt-warn { color: #93370d; }
.mt-adv { margin: .4rem 0 .8rem; }
.mt-ev label { display: flex; flex-direction: row; justify-content: flex-start; align-items: center; gap: 8px; width: auto; text-align: left; font-weight: 500; }
.mt-ev input[type=checkbox] { width: auto; flex: none; margin: 0; }

/* v44: public Privacy Policy page */
.lg-page{max-width:780px;margin:24px auto;padding:28px 32px;line-height:1.65}
.lg-page h1{margin-top:0}.lg-page h2{margin:26px 0 6px;font-size:18px}.lg-page ul{padding-left:22px}

/* v48: email template categories + reminder calendar + replies by category */
.tpl-chips{display:flex;flex-wrap:wrap;gap:.4rem;margin:.6rem 0 .8rem}.tpl-newcat{display:flex;gap:.4rem;margin:.4rem 0}.tpl-newcat input{flex:1}
.tpl-cat{margin:1rem 0 .4rem;font-size:1rem}
.rc-nav{display:flex;align-items:center;justify-content:space-between;margin-bottom:.6rem}.rc-nav h2{margin:0}
.rc-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:6px}.rc-dow{text-align:center;color:#667489;font-size:.8rem;padding:.2rem 0}
.rc-day{display:block;min-height:58px;padding:.4rem .5rem;border-radius:10px;background:#F6F8FB;color:inherit;border:2px solid transparent;font-size:.85rem}
.rc-day:hover{text-decoration:none;border-color:#cddcf6}.rc-day.blank{background:none;min-height:0}.rc-day.today{background:#FEF3C7}.rc-day.sel{background:#E7EEFB;border-color:#1d4ed8}
.rc-n{float:right;background:#1d4ed8;color:#fff;border-radius:999px;padding:0 .5rem;font-size:.75rem;font-weight:700}
.rc-seton{background:#FEF3C7;color:#92400E;border-radius:6px;padding:.1rem .45rem;font-size:.75rem;white-space:nowrap}
.rc-by{margin-top:.8rem}.rc-by .r{display:flex;align-items:center;gap:.6rem;margin:.45rem 0;font-size:.85rem;color:inherit}.rc-by .r:hover{text-decoration:none}
.rc-by .nm{width:9rem}.rc-by .bar{flex:1;height:9px;background:#EEF1F6;border-radius:6px;overflow:hidden}.rc-by .bar i{display:block;height:100%;background:#3b82f6;border-radius:6px}.rc-by b{width:2rem;text-align:right}
.rc-by progress.bar{-webkit-appearance:none;appearance:none;border:0;height:9px;background:#EEF1F6;border-radius:6px;overflow:hidden}
.rc-by progress.bar::-webkit-progress-bar{background:#EEF1F6;border-radius:6px}.rc-by progress.bar::-webkit-progress-value{background:#3b82f6;border-radius:6px}.rc-by progress.bar::-moz-progress-bar{background:#3b82f6;border-radius:6px}

/* v48: replied count next to every category / list in the sidebar */
.side-cats .cat-rep{background:rgba(52,211,153,.2);color:#6ee7b7;border-radius:999px;padding:0 .45rem;font-size:.68rem;font-weight:700;white-space:nowrap}
.side-sec .cat-key{float:right;text-transform:none;letter-spacing:0;font-weight:600;color:#6ee7b7;font-size:.68rem}

/* v48: the replied badge is its own link (opens only the replied leads of that category / list) */
.side-row{position:relative;padding-right:3.3rem}
.side-cats .side-row a.cat-rep{position:absolute;right:.3rem;top:50%;transform:translateY(-50%);width:auto;padding:.05rem .5rem;background:rgba(52,211,153,.2);color:#6ee7b7;border-radius:999px;font-size:.72rem;font-weight:700;white-space:nowrap;gap:0}
.side-cats .side-row a.cat-rep:hover{background:#34d399;color:#06281c;text-decoration:none}
.rep-banner{display:flex;align-items:center;gap:.8rem;flex-wrap:wrap;background:#ECFDF5;border:1px solid #A7F3D0;color:#065F46;border-radius:12px;padding:.7rem 1rem;margin-bottom:1rem}
.rep-banner a{font-weight:700}
.side-sec .cat-key{float:none;display:block;margin-top:.15rem}
