/* MyResalePlots CRM - brand tokens and shared styles (navy / orange, per design-reference) */
:root {
  --crm-navy: #063a63;
  --crm-navy-dark: #052c4c;
  --crm-navy-deep: #041f38;
  --crm-orange: #ff7a00;
  --crm-orange-dark: #df6700;
  --crm-soft: #f4f7fb;
  --crm-border: #e5ebf2;
  --crm-text: #17324a;
  --crm-muted: #7d8996;
  --crm-success: #22c55e;
  --crm-warning: #f59e0b;
  --crm-danger: #ef4444;
  --crm-info: #0ea5e9;
  --bs-primary: #063a63;
  --bs-primary-rgb: 6, 58, 99;
  --bs-link-color: #063a63;
  --bs-link-hover-color: #052c4c;
  --bs-body-color: #17324a;
  --bs-body-bg: #f4f7fb;
  --bs-border-color: #e5ebf2;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--crm-text);
  background: var(--crm-soft);
}
.btn-primary { --bs-btn-bg: var(--crm-navy); --bs-btn-border-color: var(--crm-navy); --bs-btn-hover-bg: var(--crm-navy-dark); --bs-btn-hover-border-color: var(--crm-navy-dark); --bs-btn-active-bg: var(--crm-navy-deep); --bs-btn-active-border-color: var(--crm-navy-deep); }
.btn-accent { --bs-btn-bg: var(--crm-orange); --bs-btn-border-color: var(--crm-orange); --bs-btn-color: #fff; --bs-btn-hover-bg: var(--crm-orange-dark); --bs-btn-hover-border-color: var(--crm-orange-dark); --bs-btn-hover-color: #fff; --bs-btn-active-bg: var(--crm-orange-dark); --bs-btn-active-color: #fff; }
.text-accent { color: var(--crm-orange) !important; }
.form-control, .form-select { border-color: var(--crm-border); min-height: 44px; }
.form-control:focus, .form-select:focus { border-color: rgba(6,58,99,.45); box-shadow: 0 0 0 .22rem rgba(6,58,99,.08); }
.form-label { font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.input-group-text { background: #fff; border-color: var(--crm-border); color: #8a96a3; }

/* ---------- Auth pages ---------- */
body.auth-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 10%, rgba(6,58,99,.08), transparent 30%),
    radial-gradient(circle at 90% 90%, rgba(255,122,0,.08), transparent 30%),
    #f6f8fb;
}
.login-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 34px 18px; }
.login-shell { width: 100%; max-width: 1180px; min-height: 680px; background: #fff; border-radius: 28px; overflow: hidden; box-shadow: 0 30px 80px rgba(18,44,67,.14); border: 1px solid rgba(229,235,242,.85); }
.promo-panel { min-height: 680px; position: relative; color: #fff; display: flex; align-items: stretch; overflow: hidden; background: linear-gradient(160deg, var(--crm-navy) 0%, var(--crm-navy-dark) 60%, var(--crm-navy-deep) 100%); }
.promo-panel::before { content: ""; position: absolute; width: 280px; height: 280px; border-radius: 50%; background: rgba(255,255,255,.06); top: -120px; right: -80px; }
.promo-panel::after { content: ""; position: absolute; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,122,0,.12); bottom: -100px; left: -80px; }
.promo-content { position: relative; z-index: 2; width: 100%; padding: 48px 46px; display: flex; flex-direction: column; justify-content: space-between; }
.logo-box { display: inline-flex; align-items: center; gap: 10px; background: rgba(255,255,255,.96); border-radius: 14px; padding: 12px 16px; max-width: 320px; box-shadow: 0 10px 30px rgba(0,0,0,.08); color: var(--crm-navy); font-weight: 800; letter-spacing: -.02em; }
.logo-box img { max-height: 44px; max-width: 100%; object-fit: contain; }
.logo-box .logo-mark { width: 38px; height: 38px; border-radius: 10px; background: var(--crm-navy); color: #fff; display: grid; place-items: center; font-size: 1.15rem; }
.logo-box .logo-mark i { color: var(--crm-orange); }
.promo-copy { max-width: 500px; margin-top: 50px; margin-bottom: 40px; }
.promo-copy h1 { font-size: clamp(2.2rem, 4vw, 4rem); line-height: 1.05; font-weight: 800; letter-spacing: -.04em; margin-bottom: 22px; }
.promo-copy .orange { color: var(--crm-orange); }
.promo-copy p { font-size: 1.08rem; color: rgba(255,255,255,.78); max-width: 440px; line-height: 1.7; }
.feature-list { display: grid; gap: 18px; }
.feature-item { display: flex; align-items: center; gap: 14px; }
.feature-icon { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 14px; display: grid; place-items: center; color: var(--crm-orange); background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.12); font-size: 1.2rem; }
.feature-item strong { display: block; font-size: .98rem; }
.feature-item span { color: rgba(255,255,255,.66); font-size: .86rem; }
.promo-footer { margin-top: 40px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.12); color: rgba(255,255,255,.68); font-size: .85rem; }
.login-panel { min-height: 680px; display: flex; align-items: center; justify-content: center; padding: 44px; background: #fff; }
.login-card { width: 100%; max-width: 430px; }
.mobile-logo { display: none; text-align: center; margin-bottom: 26px; }
.welcome-icon { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; margin-bottom: 22px; background: linear-gradient(145deg, #f7faff, #eef3f8); border: 1px solid var(--crm-border); color: var(--crm-navy); font-size: 1.8rem; }
.login-title { font-size: 2rem; font-weight: 800; margin-bottom: 8px; letter-spacing: -.03em; }
.login-subtitle { color: var(--crm-muted); margin-bottom: 30px; }
.login-panel .form-control { min-height: 50px; font-size: .95rem; }
.login-panel .input-group-text { border-radius: 12px 0 0 12px; }
.login-panel .input-group .form-control:last-child { border-radius: 0 12px 12px 0; }
.password-toggle { border: 1px solid var(--crm-border); border-left: 0; background: #fff; color: #7e8a96; border-radius: 0 12px 12px 0; padding: 0 16px; }
.btn-login { min-height: 52px; background: linear-gradient(135deg, var(--crm-navy), var(--crm-navy-dark)); border: none; border-radius: 12px; color: #fff; font-weight: 700; letter-spacing: .01em; box-shadow: 0 12px 22px rgba(6,58,99,.20); transition: .2s ease; }
.btn-login:hover, .btn-login:focus { transform: translateY(-1px); background: linear-gradient(135deg, #074975, #052f52); color: #fff; }
.forgot-link { color: var(--crm-orange); text-decoration: none; font-weight: 600; font-size: .9rem; }
.forgot-link:hover { color: var(--crm-orange-dark); }
.security-note { margin-top: 28px; padding: 13px 15px; border-radius: 12px; background: #f8fafc; color: #74808c; font-size: .85rem; border: 1px solid var(--crm-border); }
.security-note i { color: var(--crm-navy); }
.copyright { margin-top: 24px; text-align: center; color: #9aa4ae; font-size: .8rem; }
@media (max-width: 991.98px) {
  .login-wrapper { padding: 18px; }
  .login-shell { min-height: auto; max-width: 600px; }
  .promo-panel { display: none; }
  .login-panel { min-height: auto; padding: 44px 28px; }
  .mobile-logo { display: block; }
  .welcome-icon { margin-left: auto; margin-right: auto; }
  .login-title, .login-subtitle { text-align: center; }
}
@media (max-width: 575.98px) {
  .login-wrapper { padding: 0; align-items: stretch; }
  .login-shell { border-radius: 0; min-height: 100vh; box-shadow: none; border: 0; }
  .login-panel { min-height: 100vh; padding: 34px 20px; }
}

/* ---------- App shell (placeholder until Phase 9; full sidebar/topbar arrive with dashboards) ---------- */
.app-topbar { background: #fff; border-bottom: 1px solid var(--crm-border); min-height: 64px; }
.app-brand { font-weight: 800; color: var(--crm-navy); text-decoration: none; letter-spacing: -.02em; }
.app-brand i { color: var(--crm-orange); }
.avatar-circle { width: 38px; height: 38px; border-radius: 50%; background: var(--crm-navy); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.card { border: 1px solid var(--crm-border); border-radius: 16px; box-shadow: 0 6px 18px rgba(18,44,67,.05); }

/* ---------- App shell: sidebar + topbar (design-reference dashboards, navy/orange) ---------- */
.app { min-height: 100vh; }
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: 270px;
  background: linear-gradient(180deg, var(--crm-navy), var(--crm-navy-deep));
  color: #fff; padding: 20px 14px; z-index: 1035; overflow-y: auto;
  box-shadow: 8px 0 25px rgba(4,31,56,.12);
  transition: transform .25s ease;
}
.sidebar .brand { display: flex; align-items: center; gap: 12px; padding: 8px 10px 22px; color: #fff; text-decoration: none; }
.sidebar .brand-mark { width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(135deg, var(--crm-orange), #ff9a3d); display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 1.2rem; flex: 0 0 42px; }
.sidebar .brand h5 { margin: 0; font-weight: 800; letter-spacing: .2px; font-size: 1.05rem; }
.sidebar .brand small { color: #aebbc7; font-size: .75rem; }
.menu-label { font-size: .72rem; color: #8aa0b5; text-transform: uppercase; letter-spacing: .12em; padding: 15px 12px 8px; }
.sidebar .nav-link { color: #c3d0dc; border-radius: 10px; margin: 3px 0; padding: 10px 12px; display: flex; align-items: center; gap: 11px; font-size: .93rem; }
.sidebar .nav-link i { font-size: 1.05rem; width: 20px; text-align: center; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar .nav-link.active { background: rgba(255,122,0,.18); color: #fff; box-shadow: inset 3px 0 0 var(--crm-orange); }
.sidebar .nav-link .badge { margin-left: auto; }
.sidebar .signed-in { margin-top: 24px; padding: 14px; border-radius: 14px; background: rgba(255,255,255,.07); }
.sidebar .signed-in .avail { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: #c3d0dc; }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(4,31,56,.45); z-index: 1030; }
.main { margin-left: 270px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: 70px; background: #fff; border-bottom: 1px solid var(--crm-border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 24px;
  position: sticky; top: 0; z-index: 1020;
}
.topbar .searchbox { position: relative; max-width: 420px; width: 100%; }
.topbar .searchbox i { position: absolute; left: 14px; top: 12px; color: #8794a3; }
.topbar .searchbox input { padding-left: 40px; border: 1px solid var(--crm-border); background: #f8fafc; border-radius: 12px; min-height: 42px; }
.topbar .btn-light { background: #f4f7fb; border-color: #f4f7fb; }
.user-chip { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--crm-navy); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex: 0 0 38px; }
.avatar.avatar-sm { width: 32px; height: 32px; font-size: .75rem; flex-basis: 32px; }
.avatar.avatar-lg { width: 64px; height: 64px; font-size: 1.3rem; flex-basis: 64px; }
.content { padding: 26px 24px 40px; flex: 1; }
.mobile-menu { display: none; }

.page-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.page-header h1 { font-size: 1.45rem; font-weight: 800; margin: 0 0 3px; letter-spacing: -.02em; }
.page-header .subtitle { color: var(--crm-muted); font-size: .92rem; }

.stat-card { border: 1px solid var(--crm-border); border-radius: 16px; background: #fff; box-shadow: 0 8px 26px rgba(17,38,58,.045); padding: 18px; height: 100%; }
.stat-card .label { color: var(--crm-muted); font-size: .82rem; }
.stat-card h3 { font-weight: 800; margin: 2px 0 4px; font-size: 1.6rem; }
.stat-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 1.15rem; flex: 0 0 46px; }
.icon-navy { background: #e6eef6; color: var(--crm-navy); } .icon-green { background: #e8f8ef; color: #16a34a; }
.icon-orange { background: #fff1e3; color: var(--crm-orange-dark); } .icon-blue { background: #e5f5ff; color: #0284c7; }
.icon-red { background: #fdecec; color: #dc2626; } .icon-gray { background: #eef1f5; color: #64748b; }

.section-card { border: 1px solid var(--crm-border); border-radius: 16px; background: #fff; box-shadow: 0 6px 18px rgba(18,44,67,.04); }
.section-card > .card-header { background: #fff; border-bottom: 1px solid var(--crm-border); padding: 16px 20px; border-radius: 16px 16px 0 0; font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.section-card > .card-body { padding: 20px; }
.section-card > .card-footer { background: #fff; border-top: 1px solid var(--crm-border); padding: 12px 20px; border-radius: 0 0 16px 16px; }
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table thead th { font-size: .74rem; text-transform: uppercase; color: #8591a0; letter-spacing: .04em; border-bottom: 1px solid var(--crm-border); font-weight: 700; white-space: nowrap; padding: 12px 14px; }
.table td { vertical-align: middle; border-bottom: 1px solid #f0f3f6; padding: 12px 14px; font-size: .92rem; }
.table tbody tr:last-child td { border-bottom: 0; }
.table-hover tbody tr:hover { background: #f8fafc; }

.status { font-size: .74rem; font-weight: 700; padding: 5px 9px; border-radius: 999px; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.status-hot { background: #fff0f0; color: #d83b3b; } .status-warm { background: #fff7e8; color: #b86e00; }
.status-cold { background: #eaf7ff; color: #1877a6; } .status-new { background: #e6eef6; color: var(--crm-navy); }
.status-success, .status-complete { background: #eaf9ef; color: #198754; } .status-muted { background: #eef1f5; color: #64748b; }
.status-danger { background: #fdecec; color: #dc2626; } .status-warning { background: #fff7e8; color: #b86e00; }
.status-info { background: #eaf7ff; color: #1877a6; } .status-accent { background: #fff1e3; color: var(--crm-orange-dark); }
.availability { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .8rem; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.green { background: #22c55e; } .dot.red { background: #ef4444; } .dot.gray { background: #94a3b8; } .dot.orange { background: var(--crm-orange); }

.filter-bar { background: #fff; border: 1px solid var(--crm-border); border-radius: 14px; padding: 12px 14px; margin-bottom: 16px; }
.filter-bar .form-control, .filter-bar .form-select { min-height: 40px; font-size: .9rem; }
.permission-grid .form-check { padding: 9px 12px 9px 36px; border: 1px solid var(--crm-border); border-radius: 10px; background: #fbfcfe; margin: 0; }
.permission-grid .form-check-input { margin-left: -1.55rem; margin-top: .3rem; }
.permission-grid .form-check-label { font-size: .88rem; }
.role-chip { display: inline-flex; align-items: center; gap: 5px; background: #e6eef6; color: var(--crm-navy); border-radius: 999px; padding: 4px 10px; font-size: .78rem; font-weight: 700; }
.timeline { position: relative; padding-left: 23px; }
.timeline:before { content: ""; position: absolute; left: 6px; top: 7px; bottom: 0; width: 2px; background: #e6eaf0; }
.tl-item { position: relative; margin-bottom: 16px; }
.tl-item:before { content: ""; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--crm-orange); border: 2px solid #ffe4cc; }
.pagination { --bs-pagination-active-bg: var(--crm-navy); --bs-pagination-active-border-color: var(--crm-navy); --bs-pagination-color: var(--crm-navy); }
.empty-state { text-align: center; padding: 40px 20px; color: var(--crm-muted); }
.empty-state i { font-size: 2.2rem; display: block; margin-bottom: 8px; color: #b8c4d0; }
.btn-sm { padding: .3rem .6rem; }
.form-switch .form-check-input { width: 2.6em; height: 1.4em; }
.form-switch .form-check-input:checked { background-color: var(--crm-navy); border-color: var(--crm-navy); }
.form-check-input:checked { background-color: var(--crm-navy); border-color: var(--crm-navy); }
.text-navy { color: var(--crm-navy) !important; }
.bg-navy { background: var(--crm-navy) !important; }
.required::after { content: " *"; color: var(--crm-danger); }

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-backdrop { display: block; }
  .main { margin-left: 0; }
  .mobile-menu { display: inline-flex; }
  .topbar { padding: 0 14px; height: 62px; }
  .content { padding: 18px 14px 32px; }
  .topbar .searchbox { display: none; }
  .stat-card h3 { font-size: 1.35rem; }
}
@media (max-width: 575.98px) {
  .page-header h1 { font-size: 1.25rem; }
  .table td, .table thead th { padding: 10px 10px; }
}

/* ---------- Phase 5: reference data ---------- */
.transition-matrix-wrap { max-height: 75vh; }
.transition-matrix { border-collapse: separate; border-spacing: 0; }
.transition-matrix th, .transition-matrix td { border-bottom: 1px solid #f0f3f6; padding: 6px 4px; }
.transition-matrix thead th { position: sticky; top: 0; background: #fff; z-index: 2; vertical-align: bottom; text-transform: none; letter-spacing: 0; }
.transition-matrix .tm-corner { left: 0; z-index: 3; min-width: 190px; font-size: .74rem; }
.transition-matrix .tm-row { position: sticky; left: 0; background: #fff; z-index: 1; white-space: nowrap; padding-left: 14px; border-right: 1px solid var(--crm-border); }
.transition-matrix .tm-col { height: 150px; min-width: 38px; white-space: nowrap; padding: 0 0 8px; }
.transition-matrix .tm-col span { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); font-size: .78rem; font-weight: 700; color: var(--crm-text); }
.transition-matrix tbody tr:hover td, .transition-matrix tbody tr:hover .tm-row { background: #f8fafc; }
.transition-matrix .tm-inactive { background: #f6f7f9; opacity: .6; }
.transition-matrix .tm-self { color: #c3ccd6; font-weight: 800; }
.transition-matrix .form-check-input { width: 1.15em; height: 1.15em; margin: 0; cursor: pointer; }
.status-table { table-layout: fixed; min-width: 900px; }
.status-table td { overflow: hidden; text-overflow: ellipsis; }

/* ---------- Phase 6: leads ---------- */
.lead-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: 12px; background: #fff; border: 1px solid var(--crm-border); border-radius: 16px; padding: 16px 18px; }
.lead-summary .label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--crm-muted); font-weight: 700; margin-bottom: 4px; }
.detail-list { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; margin: 0; font-size: .92rem; }
.detail-list dt { color: var(--crm-muted); font-weight: 600; font-size: .84rem; }
.detail-list dd { margin: 0; }
.note-box { background: #f8fafc; border: 1px solid var(--crm-border); border-radius: 12px; padding: 12px 14px; font-size: .92rem; }
.lead-tabs { padding: 8px 12px 0; border-bottom: 1px solid var(--crm-border); }
.lead-tabs .nav-link { color: var(--crm-muted); font-weight: 600; border: 0; border-bottom: 3px solid transparent; }
.lead-tabs .nav-link.active { color: var(--crm-navy); border-bottom-color: var(--crm-orange); background: transparent; }
.btn-check:checked + .temp-hot { background: #fff0f0; color: #d83b3b; border-color: #f3b4b4; }
.btn-check:checked + .temp-warm { background: #fff7e8; color: #b86e00; border-color: #f5d49b; }
.btn-check:checked + .temp-cold { background: #eaf7ff; color: #1877a6; border-color: #a9d8f2; }
.duplicate-panel { border-left: 4px solid var(--crm-orange); }
@media (max-width: 575.98px) { .detail-list { grid-template-columns: 100px 1fr; } }

/* ---------- Phase 7: repeat enquiries ---------- */
.duplicate-action { background: rgba(255,255,255,.65); border: 1px dashed #e8c77a; border-radius: 12px; padding: 12px 14px; }
.enquiry-item { padding: 12px 0; }

/* ---------- Phase 8: routing ---------- */
.routing-history { max-height: 520px; overflow-y: auto; }

/* ---------- Phase 9: telecaller dashboard ---------- */
.nav-badge { margin-left: auto; background: var(--crm-orange); color: #fff; border-radius: 999px; font-size: .7rem; font-weight: 800; padding: 2px 8px; line-height: 1.4; }
.welcome-banner { background: linear-gradient(135deg, var(--crm-navy), var(--crm-navy-dark)); color: #fff; border-radius: 18px; padding: 22px 24px; margin-bottom: 20px; position: relative; overflow: hidden; }
.welcome-banner h1 { font-size: 1.45rem; font-weight: 800; margin: 0 0 4px; }
.welcome-banner p { margin: 0; color: #c9d7e4; }
.welcome-banner .accent { color: var(--crm-orange); font-weight: 800; }
.welcome-banner .avail { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.1); border-radius: 999px; padding: 6px 12px; font-size: .82rem; font-weight: 700; }
.queue-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f0f3f6; }
.queue-item:last-child { border-bottom: 0; }
.queue-time { min-width: 76px; font-weight: 800; color: var(--crm-navy); font-size: .88rem; }
.queue-time.overdue { color: var(--crm-danger); }
.access-note { background: #f8fafc; border: 1px dashed var(--crm-border); border-radius: 14px; padding: 14px 16px; font-size: .86rem; color: var(--crm-muted); }
.status.text-wrap { border-radius: 10px; }

/* ---------- Phase 10: feedback and follow-ups ---------- */
.feedback-offcanvas { --bs-offcanvas-width: 460px; }
.feedback-offcanvas .offcanvas-body { gap: 0; }
.followup-block { background: #f8fafc; border: 1px solid var(--crm-border); border-radius: 12px; padding: 12px; }
.feedback-item { padding: 14px 0; }
.followup-tabs .nav-link { color: var(--crm-muted); font-weight: 600; padding: 6px 12px; }
.followup-tabs .nav-link.active { background: var(--crm-navy); color: #fff; }

/* ---------- Phase 11: site visits ---------- */
.push-visit { background: #fff7ef; border: 1px solid #ffd9b3; border-radius: 12px; padding: 12px; }
.feedback-offcanvas .offcanvas-body > * { flex-shrink: 0; }

/* Notification bell (Phase 18) */
.bell-menu { width: min(360px, calc(100vw - 24px)); }
.bell-list { max-height: 60vh; overflow-y: auto; }
.bell-item { display: flex; gap: 10px; padding: 10px 14px; color: inherit; text-decoration: none; border-bottom: 1px solid #f0f3f6; font-size: .86rem; }
.bell-item:hover { background: #f7f9fc; }
.bell-item > i { color: var(--crm-navy); font-size: 1.05rem; margin-top: 2px; }
.bell-item.unread { background: #fff7ef; }
.bell-item.unread strong::after { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--crm-orange); margin-left: 6px; vertical-align: middle; }
.notif-row.unread { background: #fff7ef; }

/* ---------- Reports (Phase 19) ---------- */
.report-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.report-tab { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; padding: 9px 14px; border-radius: 12px; border: 1px solid var(--crm-border); background: #fff; color: var(--crm-text); font-weight: 600; font-size: .9rem; text-decoration: none; }
.report-tab:hover { border-color: rgba(6,58,99,.35); color: var(--crm-navy); }
.report-tab.active { background: var(--crm-navy); border-color: var(--crm-navy); color: #fff; }
.report-tab.active i { color: var(--crm-orange); }
.report-chart { position: relative; width: 100%; }
.tabular { font-variant-numeric: tabular-nums; }
.report-table { font-size: .9rem; }
.report-table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--crm-muted); font-weight: 700; white-space: nowrap; background: #fff; }
.report-table td { white-space: nowrap; vertical-align: middle; }
.report-table tfoot td { font-weight: 700; background: var(--crm-soft); border-top: 2px solid var(--crm-navy); }
.report-table .sticky-col { position: sticky; left: 0; z-index: 1; background: #fff; box-shadow: 1px 0 0 var(--crm-border); }
.report-table tfoot .sticky-col { background: var(--crm-soft); }
.report-scroll { max-height: 460px; overflow: auto; }
.report-scroll thead th { position: sticky; top: 0; z-index: 2; }
.report-scroll thead th.sticky-col { z-index: 3; }
.pct-cell { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
.pct-track { display: inline-block; width: 48px; height: 6px; border-radius: 3px; background: #eef2f7; overflow: hidden; }
.pct-bar { display: block; height: 100%; background: var(--crm-orange); border-radius: 3px; }
.pct-val { min-width: 46px; text-align: right; }
.funnel-step { display: grid; grid-template-columns: minmax(150px, 190px) 1fr minmax(120px, auto); align-items: center; gap: 12px; padding: 7px 0; }
.funnel-label { font-weight: 600; font-size: .9rem; display: flex; align-items: center; gap: 8px; }
.funnel-num { width: 22px; height: 22px; border-radius: 50%; background: #e6eef6; color: var(--crm-navy); display: inline-grid; place-items: center; font-size: .72rem; font-weight: 700; flex: 0 0 22px; }
.funnel-track { background: #eef2f7; border-radius: 8px; height: 22px; overflow: hidden; }
.funnel-fill { height: 100%; border-radius: 8px; background: var(--crm-navy); transition: width .4s ease; }
.funnel-fill-1, .funnel-fill-2 { background: #1f5f94; }
.funnel-fill-3, .funnel-fill-4 { background: var(--crm-orange); }
.funnel-fill-5, .funnel-fill-6 { background: #16a34a; }
.funnel-value { display: flex; align-items: baseline; gap: 8px; justify-content: flex-end; }
.funnel-step-rate { color: var(--crm-muted); white-space: nowrap; }
@media (max-width: 575.98px) {
  .funnel-step { grid-template-columns: 1fr auto; row-gap: 4px; }
  .funnel-track { grid-column: 1 / -1; grid-row: 2; height: 14px; }
  .funnel-step-rate { display: none; }
}

/* ---------- Management dashboards (Phase 20) ---------- */
.min-w-0 { min-width: 0; }
.avatar-sm { width: 34px; height: 34px; font-size: .78rem; flex: 0 0 34px; }
.team-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f0f3f6; }
.team-row:last-child { border-bottom: 0; }
.conv-tile { border: 1px solid var(--crm-border); border-radius: 14px; padding: 14px 16px; height: 100%; }
.conv-tile-accent { background: #fff7ef; border-color: #ffd9b3; }
.conv-value { font-size: 1.6rem; font-weight: 800; color: var(--crm-navy); line-height: 1.2; margin: 4px 0; }
.conv-tile-accent .conv-value { color: var(--crm-orange-dark); }
.mini-stat { display: block; border-radius: 12px; background: var(--crm-soft); padding: 12px 6px; text-decoration: none; color: var(--crm-text); }
.mini-stat strong { display: block; font-size: 1.4rem; font-weight: 800; color: var(--crm-navy); }
.mini-stat span { font-size: .8rem; color: var(--crm-muted); font-weight: 600; }
.mini-stat-danger strong { color: var(--crm-danger); }
.mini-stat-ok strong { color: #16a34a; }
.pipeline { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.pipeline-stage { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--crm-border); border-top: 4px solid var(--crm-navy); border-radius: 12px; padding: 12px 14px; text-decoration: none; color: var(--crm-text); }
.pipeline-stage strong { font-size: 1.5rem; font-weight: 800; color: var(--crm-navy); }
.pipeline-stage small { color: var(--crm-muted); }
.pipeline-stage:nth-child(2), .pipeline-stage:nth-child(3) { border-top-color: var(--crm-orange); }
.pipeline-done { border-top-color: #16a34a; background: #f3fbf6; }
@media (max-width: 991.98px) { .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.health-row { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f0f3f6; }
.health-row:last-child { border-bottom: 0; }
.health-row > .bi { margin-top: 2px; }
.activity-row { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid #f0f3f6; }
.activity-row:last-child { border-bottom: 0; }
.activity-time { flex: 0 0 74px; white-space: nowrap; font-size: .78rem; font-weight: 700; color: var(--crm-muted); padding-top: 2px; }
.queue-tile { display: block; height: 100%; background: #fff; border: 1px solid var(--crm-border); border-radius: 16px; padding: 16px 18px; text-decoration: none; color: var(--crm-text); box-shadow: 0 6px 18px rgba(18,44,67,.04); transition: border-color .15s, transform .15s; }
.queue-tile:hover { border-color: rgba(6,58,99,.35); transform: translateY(-1px); color: var(--crm-text); }
.queue-tile .queue-count { font-size: 1.7rem; font-weight: 800; color: #9aa7b4; line-height: 1.1; }
.queue-tile.has-items { border-left: 4px solid var(--crm-orange); }
.queue-tile.has-items .queue-count { color: var(--crm-navy); }
@media (min-width: 992px) { .border-end-lg { border-right: 1px solid var(--crm-border); } }
.settings-section { scroll-margin-top: 90px; }
.settings-events td, .settings-events th { white-space: nowrap; }
.support-line a { text-decoration: none; }
.section-card > form > .card-body { padding: 20px; }
.section-card > form > .card-footer { background: #fff; border-top: 1px solid var(--crm-border); padding: 12px 20px; border-radius: 0 0 16px 16px; }

/* ---------- Lead story timeline (Phase 21) ---------- */
.story-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.story-chip { border: 1px solid var(--crm-border); background: #fff; border-radius: 999px; padding: 4px 12px; font-size: .8rem; font-weight: 600; color: var(--crm-text); }
.story-chip span { color: var(--crm-muted); margin-left: 2px; }
.story-chip.active { background: var(--crm-navy); border-color: var(--crm-navy); color: #fff; }
.story-chip.active span { color: #c9d7e4; }
.story { position: relative; }
.story-day { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--crm-muted); margin: 14px 0 6px; }
.story-day:first-child { margin-top: 0; }
.story-item { display: flex; gap: 12px; padding: 8px 0 12px; position: relative; }
.story-item::before { content: ""; position: absolute; left: 15px; top: 40px; bottom: -4px; width: 2px; background: #eef2f7; }
.story-icon { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 32px; font-size: .9rem; position: relative; z-index: 1; }
.story-navy { background: #e6eef6; color: var(--crm-navy); } .story-blue { background: #e5f5ff; color: #0284c7; }
.story-orange { background: #fff1e3; color: var(--crm-orange-dark); } .story-green { background: #e8f8ef; color: #16a34a; }
.story-red { background: #fdecec; color: #dc2626; } .story-grey { background: #f1f4f7; color: #64748b; }
.story-body { flex: 1; min-width: 0; }
.story-text { white-space: pre-line; margin-top: 2px; }
.story-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.story-meta span { font-size: .75rem; background: var(--crm-soft); border: 1px solid var(--crm-border); border-radius: 6px; padding: 1px 7px; color: #475569; }

/* ---------- Activity Log (Phase 21) ---------- */
.log-list { border-top: 0; }
.log-row { border-bottom: 1px solid #f0f3f6; }
.log-row:last-child { border-bottom: 0; }
.log-row > summary { list-style: none; display: flex; align-items: center; gap: 14px; padding: 12px 20px; cursor: pointer; }
.log-row > summary::-webkit-details-marker { display: none; }
.log-row > summary:hover { background: #fafcfe; }
.log-row[open] > summary { background: var(--crm-soft); }
.log-row[open] .log-toggle .bi { transform: rotate(180deg); }
.log-when { flex: 0 0 76px; white-space: nowrap; display: flex; flex-direction: column; line-height: 1.2; }
.log-when strong { font-size: .85rem; color: var(--crm-navy); }
.log-when span { font-size: .72rem; color: var(--crm-muted); }
.log-main { flex: 1; min-width: 0; }
.log-toggle { flex: 0 0 auto; white-space: nowrap; }
.log-alert > summary { box-shadow: inset 3px 0 0 var(--crm-danger); }
.log-details { padding: 4px 20px 16px 110px; }
.log-changes { font-size: .85rem; max-width: 900px; }
.log-changes th { font-size: .72rem; text-transform: uppercase; color: var(--crm-muted); }
.log-changes td { word-break: break-word; }
@media (max-width: 767.98px) {
  .log-row > summary { flex-wrap: wrap; padding: 12px 16px; }
  .log-toggle { display: none; }
  .log-details { padding: 4px 16px 14px; }
}
.story-link:hover { color: var(--crm-navy) !important; text-decoration: underline !important; }

/* ---------- Global search type-ahead (Phase 22) ---------- */
.topbar .searchbox .search-suggest i { position: static; color: var(--crm-navy); }
.search-suggest { position: absolute; top: calc(100% + 6px); left: 0; right: 0; min-width: 320px; background: #fff; border: 1px solid var(--crm-border); border-radius: 14px; z-index: 1080; max-height: 70vh; overflow-y: auto; padding: 6px 0; }
.search-group { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--crm-muted); padding: 8px 14px 4px; }
.search-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 14px; text-decoration: none; color: var(--crm-text); }
.search-item span { display: flex; flex-direction: column; min-width: 0; }
.search-item strong { font-size: .88rem; }
.search-item small { color: var(--crm-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-item:hover, .search-item.active { background: var(--crm-soft); color: var(--crm-text); }
.search-empty { padding: 10px 14px; font-size: .85rem; color: var(--crm-muted); }
.search-all { display: block; border-top: 1px solid var(--crm-border); margin-top: 4px; padding: 9px 14px 4px; font-size: .85rem; font-weight: 600; text-decoration: none; }
@media (max-width: 575.98px) { .search-suggest { position: fixed; top: 64px; left: 12px; right: 12px; min-width: 0; } }
