/* ==========================================================================
   MixCRM - Design Foundation
   A small set of tokens (color, type, space, radius, shadow) drives every
   component below, so the whole product moves together when any of them
   change. Sections: tokens → base/type → shell → buttons → forms → cards →
   tables → badges → empty states → toasts → auth.
   ========================================================================== */

@font-face {
  font-family: 'Inter';
  src: url('/vendor/fonts/inter/Inter-Variable.woff2') format('woff2-variations'), url('/vendor/fonts/inter/Inter-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/vendor/fonts/inter/Inter-Italic-Variable.woff2') format('woff2-variations'), url('/vendor/fonts/inter/Inter-Italic-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  /* ---- Brand ---- */
  --mc-navy: #16255C;
  --mc-navy-2: #1E3178;
  --mc-blue: #3B6FE0;
  --mc-blue-light: #EEF3FE;
  --mc-ink: #10142A;

  /* Back-compat aliases (existing views/inline styles still reference these) */
  --mc-whitish: var(--mc-gray-50, #F6F8FC);
  --mc-green: var(--mc-success, #1F9D6E);
  --mc-red: var(--mc-danger, #DC3545);
  --mc-amber: var(--mc-warning, #D97706);

  /* ---- Neutral scale (cool gray, not blue-washed) ---- */
  --mc-gray-50:  #F6F8FC;
  --mc-gray-100: #EEF1F7;
  --mc-gray-200: #E2E6F0;
  --mc-gray-300: #CBD1E0;
  --mc-gray-400: #9AA3BC;
  --mc-gray-500: #717B9B;
  --mc-gray-600: #545E7D;
  --mc-gray-700: #3A4260;
  --mc-gray-800: #262C45;
  --mc-gray-900: #171B2E;

  /* ---- Semantic ---- */
  --mc-success: #1F9D6E;
  --mc-success-bg: #E7F7F0;
  --mc-danger: #DC3545;
  --mc-danger-bg: #FCEBEC;
  --mc-warning: #D97706;
  --mc-warning-bg: #FDF3E4;
  --mc-info: var(--mc-blue);
  --mc-info-bg: var(--mc-blue-light);

  /* ---- Type ---- */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --fs-xs: .75rem;     /* 12px */
  --fs-sm: .8125rem;   /* 13px */
  --fs-base: .875rem;  /* 14px */
  --fs-md: 1rem;       /* 16px */
  --fs-lg: 1.125rem;   /* 18px */
  --fs-xl: 1.375rem;   /* 22px */
  --fs-2xl: 1.75rem;   /* 28px */

  /* ---- Space (4px base) ---- */
  --sp-1: .25rem; --sp-2: .5rem; --sp-3: .75rem; --sp-4: 1rem;
  --sp-5: 1.25rem; --sp-6: 1.5rem; --sp-8: 2rem; --sp-10: 2.5rem;

  /* ---- Radius ---- */
  --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-xl: 16px; --r-full: 999px;

  /* ---- Elevation (restrained - enterprise UI leans on borders, not shadow) ---- */
  --shadow-xs: 0 1px 2px rgba(16, 20, 42, .05);
  --shadow-sm: 0 1px 3px rgba(16, 20, 42, .07), 0 1px 2px rgba(16, 20, 42, .05);
  --shadow-md: 0 4px 12px rgba(16, 20, 42, .08), 0 2px 4px rgba(16, 20, 42, .04);
  --shadow-lg: 0 12px 32px rgba(16, 20, 42, .12), 0 4px 8px rgba(16, 20, 42, .04);
  --shadow-focus: 0 0 0 3px rgba(59, 111, 224, .22);

  --ease: cubic-bezier(.4, 0, .2, 1);
  --sidebar-width: 252px;
  --sidebar-collapsed-width: 72px;
  --topbar-height: 60px;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  background: var(--mc-gray-50);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  color: var(--mc-gray-800);
  line-height: 1.5;
  margin: 0;
}

h1, h2, h3, h4, h5, h6 { font-weight: 600; color: var(--mc-ink); letter-spacing: -.01em; }
a { color: var(--mc-blue); }
small, .small { color: var(--mc-gray-500); }
hr { border-color: var(--mc-gray-200); }

::selection { background: var(--mc-blue-light); color: var(--mc-navy); }

*:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: var(--r-sm);
}

/* ---------- Shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.app-sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--mc-navy) 0%, #101C48 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  transition: width .18s var(--ease);
  z-index: 40;
}
body.sidebar-collapsed .app-sidebar { width: var(--sidebar-collapsed-width); }
body.sidebar-collapsed .app-sidebar .brand-name,
body.sidebar-collapsed .app-sidebar .nav-link span,
body.sidebar-collapsed .app-sidebar .sidebar-bottom-link span { display: none; }
body.sidebar-collapsed .app-sidebar .sidebar-brand { justify-content: center; padding-left: 0; padding-right: 0; }
body.sidebar-collapsed .app-sidebar .brand-logo { display: none; }
body.sidebar-collapsed .app-sidebar .nav-link,
body.sidebar-collapsed .app-sidebar .sidebar-bottom-link { justify-content: center; padding-left: 0; padding-right: 0; }
body.sidebar-collapsed .app-sidebar .dropdown-toggle::after { display: none; }
body.sidebar-collapsed .app-sidebar .sidebar-collapse-btn i { transform: rotate(180deg); }

.sidebar-collapse-btn {
  position: absolute; top: 22px; right: -12px; width: 24px; height: 24px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid var(--mc-gray-200); background: #fff; color: var(--mc-gray-600);
  box-shadow: 0 1px 3px rgba(0,0,0,.15); cursor: pointer; z-index: 41;
  transition: background .12s var(--ease), color .12s var(--ease);
}
.sidebar-collapse-btn:hover { background: var(--mc-gray-50); color: var(--mc-blue); }
.sidebar-collapse-btn i { font-size: 16px; transition: transform .18s var(--ease); }

/* Tooltips for icon-only (collapsed) nav */
body.sidebar-collapsed .app-sidebar .nav-link[data-tip]:hover::after {
  content: attr(data-tip); position: fixed; left: calc(var(--sidebar-collapsed-width) + 6px);
  background: var(--mc-navy); color: #fff; padding: 4px 10px; border-radius: var(--r-md);
  font-size: var(--fs-xs); white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.25); pointer-events: none; z-index: 60;
}
body.sidebar-collapsed .app-main { margin-left: var(--sidebar-collapsed-width); }

.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px 16px; font-weight: 700; font-size: var(--fs-lg); letter-spacing: -.01em; }
.brand-logo { width: 26px; height: 26px; flex-shrink: 0; }

.sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: var(--sp-2) var(--sp-3) var(--sp-4); }
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: var(--r-full); }

.nav-link {
  display: flex; align-items: center; gap: 12px;
  color: rgba(255,255,255,.68); text-decoration: none;
  padding: 8px 12px; border-radius: var(--r-md); font-size: var(--fs-sm); font-weight: 500;
  margin-bottom: 1px; white-space: nowrap;
  position: relative;
  transition: background .12s var(--ease), color .12s var(--ease);
}
.nav-link i { font-size: 18px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.active { background: rgba(255,255,255,.1); color: #fff; font-weight: 600; }
.nav-link.active::before {
  content: ''; position: absolute; left: -6px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: var(--r-full); background: #6D97F5;
}
body.sidebar-collapsed .nav-link.active::before { display: none; }
.nav-divider { border-top: 1px solid rgba(255,255,255,.1); margin: 10px 10px; }

.sidebar-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 8px; }
.sidebar-bottom-link { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.68); text-decoration: none; padding: 8px 10px; border-radius: var(--r-md); font-size: var(--fs-sm); font-weight: 500; transition: background .12s var(--ease), color .12s var(--ease); }
.sidebar-bottom-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.avatar-circle { width: 24px; height: 24px; border-radius: 50%; background: var(--mc-blue); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }

.app-main { margin-left: var(--sidebar-width); flex: 1; transition: margin-left .18s var(--ease); min-width: 0; }

.app-topbar {
  height: var(--topbar-height); background: rgba(255,255,255,.85); backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--mc-gray-200);
  display: flex; align-items: center; gap: 16px; padding: 0 20px; position: sticky; top: 0; z-index: 30;
}
.topbar-search { flex: 1; max-width: 420px; position: relative; }
.topbar-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--mc-gray-400); font-size: 16px; }
.topbar-search input {
  width: 100%; border: 1px solid var(--mc-gray-200); background: var(--mc-gray-50); border-radius: var(--r-md);
  padding: 8px 12px 8px 34px; font-size: var(--fs-sm); font-family: inherit; color: var(--mc-gray-800);
  transition: border-color .12s var(--ease), background .12s var(--ease), box-shadow .12s var(--ease);
}
.topbar-search input:focus { outline: none; background: #fff; border-color: var(--mc-blue); box-shadow: var(--shadow-focus); }
.topbar-search input::placeholder { color: var(--mc-gray-400); }


.app-content { padding: var(--sp-6); max-width: 1400px; }

/* ---------- Page basics ---------- */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-6); gap: var(--sp-4); }
.page-header h1 { font-size: var(--fs-xl); font-weight: 700; margin: 0; color: var(--mc-ink); }

/* ---------- Buttons ---------- */
.btn {
  font-size: var(--fs-sm); font-weight: 600; border-radius: var(--r-md);
  padding: 7px 14px; transition: background .12s var(--ease), border-color .12s var(--ease), box-shadow .12s var(--ease), transform .05s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 5px 10px; font-size: var(--fs-xs); }
.btn-lg { padding: 10px 20px; font-size: var(--fs-md); }

.btn-primary { background: var(--mc-blue); border-color: var(--mc-blue); box-shadow: 0 1px 2px rgba(59,111,224,.25); }
.btn-primary:hover, .btn-primary:focus { background: var(--mc-navy-2); border-color: var(--mc-navy-2); }
.btn-primary:active { background: var(--mc-navy); border-color: var(--mc-navy); }
.btn-primary:disabled { background: var(--mc-gray-300); border-color: var(--mc-gray-300); box-shadow: none; }

.btn-outline-secondary, .btn-light { border-color: var(--mc-gray-200); color: var(--mc-gray-700); background: #fff; }
.btn-outline-secondary:hover, .btn-light:hover { background: var(--mc-gray-50); border-color: var(--mc-gray-300); color: var(--mc-gray-800); }

.btn-outline-danger { color: var(--mc-danger); border-color: #F3C7CB; }
.btn-outline-danger:hover { background: var(--mc-danger); border-color: var(--mc-danger); }

.btn-outline-success { color: var(--mc-success); border-color: #B9E5D3; }
.btn-outline-success:hover { background: var(--mc-success); border-color: var(--mc-success); }

.btn:focus-visible { box-shadow: var(--shadow-focus); }

/* ---------- Forms ---------- */
.form-label { font-size: var(--fs-sm); font-weight: 600; color: var(--mc-gray-700); margin-bottom: 6px; }
.form-control, .form-select {
  border: 1px solid var(--mc-gray-200); border-radius: var(--r-md); font-size: var(--fs-base); font-family: inherit;
  padding: 8px 12px; color: var(--mc-gray-800);
  transition: border-color .12s var(--ease), box-shadow .12s var(--ease);
}
.form-control:focus, .form-select:focus { border-color: var(--mc-blue); box-shadow: var(--shadow-focus); }
.form-control::placeholder { color: var(--mc-gray-400); }
.form-control-sm, .form-select-sm { padding: 5px 9px; font-size: var(--fs-sm); }
.form-check-input:checked { background-color: var(--mc-blue); border-color: var(--mc-blue); }
.form-check-input:focus { box-shadow: var(--shadow-focus); }

/* ---------- Cards ---------- */
.card { border: 1px solid var(--mc-gray-200); border-radius: var(--r-lg); box-shadow: none; }
.card:has(.card-header) .card-header { background: transparent; border-bottom: 1px solid var(--mc-gray-200); font-weight: 600; }

.kpi-card { background: #fff; border: 1px solid var(--mc-gray-200); border-radius: var(--r-lg); padding: var(--sp-4) var(--sp-5); }
.kpi-card .kpi-label { font-size: var(--fs-xs); color: var(--mc-gray-500); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi-card .kpi-value { font-size: 1.65rem; font-weight: 700; color: var(--mc-ink); margin-top: 6px; letter-spacing: -.01em; }

.kpi-card-link { display: block; text-decoration: none; color: inherit; transition: box-shadow .15s var(--ease), transform .15s var(--ease), border-color .15s var(--ease); border-radius: var(--r-lg); }
.kpi-card-link:hover .kpi-card { box-shadow: var(--shadow-md); border-color: #C7D5F7; }
.kpi-card-link:hover { transform: translateY(-2px); }
.kpi-card-link:focus-visible { box-shadow: var(--shadow-focus); }

/* ---------- Tables ---------- */
.table { font-size: var(--fs-sm); color: var(--mc-gray-800); }
.table thead th {
  font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--mc-gray-500);
  border-bottom: 1px solid var(--mc-gray-200); padding: 10px 12px; background: var(--mc-gray-50);
}
.table tbody td { padding: 12px; vertical-align: middle; border-bottom: 1px solid var(--mc-gray-100); }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--mc-gray-50); }
.table-hover tbody tr { transition: background .1s var(--ease); }

/* ---------- Badges ---------- */
.badge { font-weight: 600; font-size: var(--fs-xs); padding: 4px 9px; border-radius: var(--r-full); letter-spacing: .01em; }
.badge.bg-light { background: var(--mc-gray-100) !important; color: var(--mc-gray-600) !important; border: 1px solid var(--mc-gray-200) !important; }
.badge-success, .badge.bg-success { background: var(--mc-success-bg) !important; color: var(--mc-success) !important; }
.badge-danger, .badge.bg-danger { background: var(--mc-danger-bg) !important; color: var(--mc-danger) !important; }
.badge-warning, .badge.bg-warning { background: var(--mc-warning-bg) !important; color: var(--mc-warning) !important; }
.badge-info, .badge.bg-info { background: var(--mc-info-bg) !important; color: var(--mc-info) !important; }

/* ---------- Empty states ---------- */
.empty-state { text-align: center; padding: 64px 20px; color: var(--mc-gray-500); }
.empty-state i { font-size: 40px; color: var(--mc-gray-300); margin-bottom: 12px; }
.empty-state h5 { color: var(--mc-gray-700); margin-bottom: 6px; }

/* ---------- Toasts (bottom-left) ---------- */
.toast-stack {
  position: fixed; left: 20px; bottom: 20px; z-index: 9999;
  display: flex; flex-direction: column-reverse; gap: 10px; width: 336px;
}
.app-toast {
  display: flex; align-items: flex-start; gap: 10px;
  background: #fff; border: 1px solid var(--mc-gray-200); border-left: 3px solid var(--mc-blue);
  border-radius: var(--r-md); padding: 12px 14px; box-shadow: var(--shadow-lg);
  animation: toast-in .18s var(--ease);
}
.app-toast-success { border-left-color: var(--mc-success); }
.app-toast-error { border-left-color: var(--mc-danger); }
.app-toast-warning { border-left-color: var(--mc-warning); }
.app-toast-info { border-left-color: var(--mc-blue); }
.app-toast-icon i { font-size: 18px; color: var(--mc-blue); }
.app-toast-success .app-toast-icon i { color: var(--mc-success); }
.app-toast-error .app-toast-icon i { color: var(--mc-danger); }
.app-toast-warning .app-toast-icon i { color: var(--mc-warning); }
.app-toast-title { font-weight: 600; font-size: var(--fs-sm); color: var(--mc-ink); }
.app-toast-message { font-size: var(--fs-sm); color: var(--mc-gray-500); }
.app-toast-close { margin-left: auto; background: none; border: 0; color: var(--mc-gray-400); cursor: pointer; }
.app-toast-close:hover { color: var(--mc-gray-600); }
.app-toast-hide { opacity: 0; transform: translateY(6px); transition: all .2s var(--ease); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Auth pages ---------- */
.auth-shell { min-height: 100vh; display: flex; background: #fff; }

.auth-brand-panel {
  flex: 0 0 42%; max-width: 560px; min-height: 100vh; position: relative; overflow: hidden;
  background: radial-gradient(120% 140% at 15% 0%, var(--mc-navy-2) 0%, var(--mc-navy) 45%, #0D1638 100%);
  color: #fff; display: flex; flex-direction: column; padding: var(--sp-8) var(--sp-10);
}
.auth-brand-panel::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.13) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.6), transparent 70%);
  pointer-events: none;
}
.auth-brand-mark { display: flex; align-items: center; gap: 10px; font-size: var(--fs-lg); font-weight: 700; letter-spacing: -.01em; position: relative; z-index: 1; }
.auth-brand-mark img { width: 28px; height: 28px; }
.auth-brand-copy { margin-top: auto; margin-bottom: auto; max-width: 400px; position: relative; z-index: 1; }
.auth-brand-copy h2 { color: #fff; font-size: 1.85rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; margin-bottom: var(--sp-4); }
.auth-brand-copy p { color: rgba(255,255,255,.72); font-size: var(--fs-md); line-height: 1.6; }
.auth-trust-list { list-style: none; margin: var(--sp-6) 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; position: relative; z-index: 1; }
.auth-trust-list li { display: flex; align-items: center; gap: 10px; font-size: var(--fs-sm); color: rgba(255,255,255,.85); }
.auth-trust-list i { color: #7FD9AE; font-size: 16px; flex-shrink: 0; }
.auth-brand-foot { font-size: var(--fs-xs); color: rgba(255,255,255,.45); position: relative; z-index: 1; }

.auth-form-panel { flex: 1; display: flex; align-items: center; justify-content: center; padding: var(--sp-6); background: var(--mc-gray-50); }

.auth-card { background: #fff; border: 1px solid var(--mc-gray-200); border-radius: var(--r-xl); box-shadow: var(--shadow-md); padding: 40px; width: 100%; max-width: 400px; }
.auth-card h1 { color: var(--mc-ink); font-size: var(--fs-xl); font-weight: 700; margin-bottom: 4px; letter-spacing: -.01em; }

.oauth-buttons { display: flex; flex-direction: column; gap: 10px; }
.btn-oauth {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 1px solid var(--mc-gray-200); background: #fff; border-radius: var(--r-md);
  padding: 9px 14px; font-size: var(--fs-sm); font-weight: 600; color: var(--mc-gray-700);
  text-decoration: none; transition: background .12s var(--ease), border-color .12s var(--ease);
}
.btn-oauth:hover { background: var(--mc-gray-50); border-color: var(--mc-gray-300); color: var(--mc-gray-800); }
.btn-oauth img { width: 18px; height: 18px; flex-shrink: 0; }

.auth-divider { display: flex; align-items: center; gap: 12px; margin: var(--sp-5) 0; color: var(--mc-gray-400); font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--mc-gray-200); }

@media (max-width: 900px) {
  .auth-brand-panel { display: none; }
}

/* ---- Contacts: operations UI ---- */
.contacts-table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.contacts-table th.sortable:hover { color: var(--mc-blue); }
.contacts-table td, .contacts-table th { vertical-align: middle; font-size: var(--fs-sm); }
.contacts-table .col-check { width: 36px; }
.contacts-table td.inline { cursor: text; }
.contacts-table td.inline:hover .v { border-bottom: 1px dashed var(--mc-gray-400); }
.contacts-table td.editing { min-width: 150px; }
.contacts-table tr.row-archived td { opacity: .65; }
.bulk-bar { border-color: var(--mc-blue); background: #f5f8ff; }
.table-loading { position: absolute; inset: 0; background: rgba(255,255,255,.6); z-index: 5; display: flex; align-items: center; justify-content: center; }
.stat-box { background: var(--mc-gray-50); border: 1px solid var(--mc-gray-200); border-radius: var(--r-md); padding: 10px 6px; }
.stat-num { font-size: 20px; font-weight: 700; line-height: 1.1; }
.stat-lbl { font-size: var(--fs-xs); color: var(--mc-gray-500); }
.op-row { cursor: pointer; }
.op-tracker { position: fixed; right: 20px; bottom: 20px; width: 280px; z-index: 1080; display: flex; flex-direction: column; gap: 8px; }
.op-track-item { background: #fff; border: 1px solid var(--mc-gray-200); border-radius: var(--r-md); padding: 10px 12px; box-shadow: 0 4px 14px rgba(16,28,72,.15); }
.wizard-steps { color: var(--mc-gray-500); margin-top: 2px; }
.wizard-steps .wiz-step.active { color: var(--mc-blue); font-weight: 700; }
.wizard-steps .wiz-step.done { color: var(--mc-gray-700); }
.pre { white-space: pre-wrap; }
/* The sidebar's .nav-link styling is global; restore normal look inside page-level tabs/pills */
#contactTabs .nav-link, #detailTabs .nav-link, #addContactTabs .nav-link, #upTabs .nav-link { color: var(--mc-gray-600); background: transparent; margin: 0; padding: .5rem 1rem; gap: 0; }
#contactTabs .nav-link::before, #detailTabs .nav-link::before { display: none; }
#contactTabs .nav-link:hover, #detailTabs .nav-link:hover { color: var(--mc-ink); background: transparent; }
#contactTabs .nav-link.active, #detailTabs .nav-link.active { color: var(--mc-blue); background: #fff; font-weight: 600; }
#upTabs .nav-link.active, #addContactTabs .nav-link.active { color: #fff; background: var(--mc-blue); }
#paneContacts .form-select.w-auto, #paneAccounts .form-select.w-auto, #paneOps .form-select.w-auto { min-width: 140px; padding-right: 2rem; }

.drop-zone { border: 2px dashed var(--mc-gray-300); border-radius: var(--r-lg); padding: 28px; text-align: center; background: var(--mc-gray-50); transition: background .12s, border-color .12s; }
.drop-zone.drag { border-color: var(--mc-blue); background: #eef3ff; }
#optTabs .nav-link { color: var(--mc-gray-600); background: transparent; margin: 0; padding: .35rem .8rem; gap: 0; }
#optTabs .nav-link.active { color: #fff; background: var(--mc-blue); }

/* Deals pipeline board */
.kanban-scroll { overflow-x: auto; padding-bottom: 8px; }
.kanban-board { display: flex; gap: 12px; align-items: flex-start; min-height: 320px; }
.kanban-column { flex: 0 0 280px; background: var(--mc-gray-50); border: 1px solid var(--mc-gray-200); border-radius: var(--r-md); display: flex; flex-direction: column; max-height: 72vh; transition: box-shadow .12s, background .12s; }
.kanban-column.drop-target { background: #eef3ff; box-shadow: 0 0 0 2px var(--mc-blue); }
.kanban-column-header { display: flex; padding: 10px 12px; font-weight: 600; font-size: 13px; background: #fff; border-radius: var(--r-md) var(--r-md) 0 0; }
.kanban-cards { padding: 8px; overflow-y: auto; flex: 1; min-height: 60px; }
.kanban-card { background: #fff; border: 1px solid var(--mc-gray-200); border-radius: var(--r-md); padding: 10px; margin-bottom: 8px; cursor: grab; box-shadow: 0 1px 2px rgba(16,28,72,.06); }
.kanban-card:hover { box-shadow: 0 3px 10px rgba(16,28,72,.12); }
.kanban-card-title { font-weight: 600; font-size: 13px; color: var(--mc-gray-900, #1b2559); }
.kanban-card-meta { font-size: 12px; color: var(--mc-gray-600, #6b7280); margin: 2px 0 6px; }
.kanban-card-amount { font-weight: 600; font-size: 13px; }
.kanban-empty { text-align: center; padding: 14px 0; }

/* Settings > Email tabs (the global nav-link colour is the sidebar's light text) */
.email-tabs .nav-link { color: var(--mc-gray-600); background: transparent; margin: 0 0 -1px; gap: 0; padding: .5rem 1rem; }
.email-tabs .nav-link::before { display: none; }
.email-tabs .nav-link:hover { color: var(--mc-blue); background: transparent; }
.email-tabs .nav-link.active { color: var(--mc-blue); background: #fff; font-weight: 600; }

/* Ticket composer tabs (inside a card header the global nav-link colour is the sidebar's light text) */
#composerTabs .nav-link { color: var(--mc-gray-600, #5b6785); }
#composerTabs .nav-link.active { color: var(--mc-blue, #488BFD); font-weight: 600; }
#composerTabs .nav-link:hover { color: var(--mc-blue, #488BFD); }
.ticket-thread .msg .card-body { font-size: 14px; }

/* ===== Calendar ===== */
.cal-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 12px; align-items: start; }
.cal-side { position: sticky; top: 8px; }
.cal-side-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--mc-gray-500, #8a94b0); margin-bottom: 4px; }
.cal-check { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 2px; cursor: pointer; }
.cal-check .dot, .cal-ag-row .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; text-align: center; font-size: 11px; }
.mini-dow { color: var(--mc-gray-500, #8a94b0); font-weight: 600; padding: 2px 0; }
.mini-day { position: relative; padding: 4px 0; border-radius: 4px; color: var(--mc-gray-800, #2b3556); text-decoration: none; }
.mini-day:hover { background: var(--mc-gray-100, #eef1f8); } .mini-day.muted { color: #b3bcd4; }
.mini-day.today { font-weight: 700; color: var(--mc-blue, #488BFD); } .mini-day.wk { background: #eef3ff; } .mini-day.sel { background: var(--mc-blue, #488BFD); color: #fff; }
.mini-dot { position: absolute; left: 50%; bottom: 1px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--mc-blue, #488BFD); } .mini-day.sel .mini-dot { background: #fff; }
.cal-canvas { min-height: 420px; overflow-x: auto; }
.cal-month { min-width: 640px; } .cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--mc-navy, #1C3988); color: #fff; font-size: 12px; font-weight: 600; text-align: center; }
.cal-dow > div { padding: 6px 0; } .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: #e3e9f5; }
.cal-cell { background: #fff; min-height: 104px; padding: 4px; font-size: 12px; } .cal-cell.muted { background: #fafbfd; } .cal-cell.today { background: #eef4ff; } .cal-cell.drop, .cal-adcell.drop, .cal-team-cell.drop { outline: 2px dashed var(--mc-blue, #488BFD); outline-offset: -2px; }
.cal-date { font-weight: 600; text-align: right; margin-bottom: 2px; } .cal-date a { color: inherit; text-decoration: none; padding: 0 3px; } .cal-cell.muted .cal-date a { color: #b3bcd4; }
.cal-chip { border-radius: 4px; padding: 1px 5px; margin-bottom: 2px; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; } .cal-chip:hover { filter: brightness(.96); }
.cal-chip.cancelled, .cal-ev.cancelled { text-decoration: line-through; opacity: .6; } .cal-chip.done, .cal-ev.done { opacity: .75; }
.cal-task { background: #e3f7e8; color: #1a7a3a; border-left: 3px solid #67C27C; } .cal-task.done { text-decoration: line-through; }
.cal-more { font-size: 11px; color: var(--mc-gray-600, #5b6785); }
.cal-week { min-width: 720px; } .cal-wk-head, .cal-wk-allday { display: grid; grid-template-columns: 52px repeat(var(--cols), minmax(0, 1fr)); } .cal-wk-head { background: #fff; border-bottom: 1px solid #e3e9f5; }
.cal-colhead { padding: 6px; text-align: center; font-size: 12px; border-left: 1px solid #e3e9f5; } .cal-colhead a { color: inherit; text-decoration: none; } .cal-colhead.today { background: #eef4ff; }
.cal-gutter { font-size: 10px; color: var(--mc-gray-500, #8a94b0); text-align: right; padding-right: 4px; } .cal-wk-allday { border-bottom: 1px solid #e3e9f5; min-height: 26px; } .cal-adcell { border-left: 1px solid #e3e9f5; padding: 2px; min-height: 26px; }
.cal-wk-scroll { max-height: 640px; overflow-y: auto; position: relative; } .cal-wk-body { display: grid; grid-template-columns: 52px repeat(var(--cols), minmax(0, 1fr)); }
.cal-hour { border-top: 1px solid #eef1f8; position: relative; } .cal-hour span { position: relative; top: -7px; background: #fff; padding-right: 2px; }
.cal-col { position: relative; border-left: 1px solid #e3e9f5; background-image: linear-gradient(#eef1f8 1px, transparent 1px); background-size: 100% 60px; min-height: 1440px; } .cal-col.today { background-color: #f7faff; }
.cal-ev { position: absolute; border-radius: 4px; padding: 1px 4px; font-size: 11px; overflow: hidden; cursor: pointer; user-select: none; z-index: 2; box-shadow: 0 1px 2px rgba(16,28,72,.12); } .cal-ev-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-resize { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; cursor: ns-resize; } .cal-now { position: absolute; left: 0; right: 0; height: 2px; background: #dc3545; z-index: 3; }
.cal-selbox { position: absolute; left: 2px; right: 2px; background: rgba(72,139,253,.25); border: 1px solid #488BFD; border-radius: 3px; z-index: 1; pointer-events: none; }
.cal-agenda { padding: 0 0 8px; } .cal-ag-head { padding: 8px 12px; border-bottom: 1px solid #e3e9f5; } .cal-ag-day { padding: 8px 12px; font-weight: 600; background: #f6f8fd; border-top: 1px solid #e3e9f5; } .cal-ag-day.today { background: #eef4ff; }
.cal-ag-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid #f0f3fa; } .cal-ag-time { width: 120px; flex-shrink: 0; font-size: 12px; color: var(--mc-gray-600, #5b6785); }
.cal-team { font-size: 12px; } .cal-team th.today { background: #eef4ff; } .cal-team-user { min-width: 150px; white-space: nowrap; font-weight: 600; } .cal-team-cell { min-width: 110px; vertical-align: top; }
@media (max-width: 991.98px) {
  .cal-layout { grid-template-columns: 1fr; } .cal-side { display: none; position: static; } .cal-side.open { display: block; }
  .cal-cell { min-height: 76px; padding: 2px; } .cal-chip { font-size: 10px; } .cal-ag-time { width: 86px; } .cal-ag-row { flex-wrap: wrap; }
}
@media (max-width: 575.98px) { .cal-header h1 { font-size: 1.15rem; } .cal-month { min-width: 0; } .cal-week { min-width: 560px; } }
/* Calendar on phones: nothing may push the page wider than the screen */
.cal-main { min-width: 0; }
@media (max-width: 991.98px) { .cal-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 575.98px) { #viewSwitch, #scopeSwitch { flex-wrap: wrap; width: 100%; } #viewSwitch .btn, #scopeSwitch .btn { flex: 1 1 auto; padding: 2px 6px; font-size: 12px; } #calTitle { font-size: 1rem; } }

/* =====================================================================
   Enterprise layer: roomier layout, grouped navigation, clearer tables
   ===================================================================== */
:root { --sidebar-width: 264px; --topbar-height: 62px; }
html { scroll-behavior: auto; }
body.modal-open { overflow: hidden; }

/* scrolling: the page scrolls as one document; the sidebar list scrolls on its own and never traps the wheel */
.app-shell { align-items: stretch; }
.app-main { display: flex; flex-direction: column; min-height: 100vh; }
.app-content { flex: 1; width: 100%; max-width: 1760px; margin: 0 auto; padding: 28px 32px 56px; }
.sidebar-nav { min-height: 0; overscroll-behavior: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.cal-wk-scroll { max-height: min(640px, 72vh); overscroll-behavior: auto; }
.kanban-cards { overscroll-behavior: auto; }
.table-responsive { overscroll-behavior-x: contain; }

/* grouped sidebar */
.nav-section { padding: 16px 12px 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: rgba(255,255,255,.38); }
.nav-section:first-child { padding-top: 6px; }
.nav-link { padding: 9px 12px; }
body.sidebar-collapsed .nav-section { padding: 10px 0 2px; text-align: center; }
body.sidebar-collapsed .nav-section span { display: none; }
body.sidebar-collapsed .nav-section::before { content: ''; display: block; border-top: 1px solid rgba(255,255,255,.12); margin: 0 14px; }

/* top bar */
.app-topbar { padding: 0 32px; gap: 20px; }
.topbar-search { max-width: 520px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.topbar-workspace { font-size: var(--fs-sm); font-weight: 600; color: var(--mc-gray-600); display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--mc-gray-200); border-radius: var(--r-md); background: #fff; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-icon { position: relative; color: var(--mc-gray-600); font-size: 22px; line-height: 1; display: inline-flex; padding: 6px; border-radius: var(--r-md); text-decoration: none; }
.topbar-icon:hover { background: var(--mc-gray-100); color: var(--mc-ink); }
.topbar-icon .badge { position: absolute; top: 0; right: 0; font-size: 10px; }
@media (max-width: 991px) { .topbar-workspace { display: none; } .app-content { padding: 20px 16px 48px; } .app-topbar { padding: 0 16px; } }

/* page headers and cards */
.page-header { padding-bottom: 16px; margin-bottom: 22px; border-bottom: 1px solid var(--mc-gray-200); flex-wrap: wrap; }
.page-header h1 { font-size: 1.5rem; display: flex; align-items: center; gap: 10px; }
.page-header h1 > i { color: var(--mc-blue); font-size: 1.4em; }
.card { border-color: var(--mc-gray-200); border-radius: 10px; box-shadow: 0 1px 2px rgba(16,28,72,.04); }
.card-header { border-bottom-color: var(--mc-gray-200); }
.kpi-card { border: 1px solid var(--mc-gray-200); border-radius: 10px; box-shadow: 0 1px 2px rgba(16,28,72,.04); }
.nav-tabs { border-bottom-color: var(--mc-gray-200); }

/* tables: clearer headers, comfortable rows, sticky header inside scrolling tables */
.table > :not(caption) > * > * { padding: .7rem .85rem; vertical-align: middle; }
.table thead th { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--mc-gray-500); background: var(--mc-gray-50); border-bottom: 1px solid var(--mc-gray-200); white-space: nowrap; }
.table-hover > tbody > tr:hover > * { background: #f5f8ff; }
.table-responsive { border-radius: 10px; }
th.sortable { cursor: pointer; user-select: none; } th.sortable:hover { color: var(--mc-blue); }
.empty-state { padding: 56px 20px; }

/* forms and filters */
.form-label { font-size: 12.5px; font-weight: 600; color: var(--mc-gray-600); margin-bottom: 4px; }
.form-control, .form-select { border-color: var(--mc-gray-300, #d5d9e4); }
.form-control-sm, .form-select-sm { min-height: 34px; }
.bulk-bar { border-left: 3px solid var(--mc-blue); }
.modal-content { border-radius: 12px; border: 0; box-shadow: 0 20px 50px rgba(16,28,72,.22); }
.modal-header { border-bottom-color: var(--mc-gray-200); } .modal-footer { border-top-color: var(--mc-gray-200); }

/* selects: keep room for the arrow (the padding shorthands above would otherwise cover it) */
.form-select { padding-right: 2.25rem; background-position: right .75rem center; }
.form-select-sm { padding-right: 2rem; background-position: right .6rem center; }
.input-group > .form-select { padding-right: 2rem; }

/* search-as-you-type result lists (deal / invoice pickers): opaque, bordered, above following fields */
.pick-results { position: absolute; left: 0; right: 0; top: 100%; z-index: 1056; max-height: 240px; overflow-y: auto; background: #fff; border: 1px solid var(--mc-gray-200); border-radius: var(--r-md); box-shadow: 0 8px 24px rgba(16,28,72,.14); margin-top: 2px; }
.pick-results:empty { display: none; }
.pick-results .list-group-item { border-left: 0; border-right: 0; border-radius: 0; white-space: normal; }
.pick-results .pick-empty { padding: 8px 12px; font-size: var(--fs-sm); color: var(--mc-gray-500); }
.pick-wrap { position: relative; }

/* invoice line items */
#itemsTable th, #itemsTable td { vertical-align: top; }
#itemsTable .ln-total { padding-top: 10px; white-space: nowrap; }
#itemsTable .ln-dates { display: flex; gap: 4px; margin-top: 4px; }
#itemsTable .ln-dates .form-control { min-width: 0; flex: 1 1 0; }
.tax-pick .ln-tax { display: none; margin-top: 4px; }
.tax-pick.is-custom .ln-tax { display: block; }
#itemsTable { table-layout: fixed; }
#itemsTable .ln-disc { min-width: 0; }

/* proposal template builder steps (page-level pills; the sidebar .nav-link look must not leak in) */
#tbSteps .nav-link { color: var(--mc-gray-700); background: var(--mc-gray-100); margin: 0; padding: .25rem .65rem; gap: 0; border-radius: 999px; font-size: var(--fs-sm); }
#tbSteps .nav-link::before { display: none; }
#tbSteps .nav-link:hover { color: var(--mc-ink); background: var(--mc-gray-200); }
#tbSteps .nav-link.active { color: #fff; background: var(--mc-blue); font-weight: 600; }

/* ---- Engage ---- */
.engage-tabs { gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--mc-gray-200); padding-bottom: 8px; }
.engage-tabs .nav-link { color: #42526e; padding: 6px 12px; border-radius: 8px; font-size: .875rem; display: inline-flex; align-items: center; gap: 6px; }
.engage-tabs .nav-link:hover { background: #f1f4fa; }
.engage-tabs .nav-link.active { background: var(--mc-blue, #488bfd); color: #fff; }
.engage-tabs .nav-link.active .badge { background: #fff !important; color: var(--mc-blue, #488bfd); }
.eng-pills .nav-link { color: #42526e; background: #fff; border: 1px solid #dfe4ee; }
.eng-pills .nav-link.active { background: var(--mc-blue, #488bfd); border-color: var(--mc-blue, #488bfd); color: #fff; }
.eng-pills .nav-link .badge { font-weight: 600; }
.eng-inbox { display: grid; grid-template-columns: 340px minmax(0, 1fr) 300px; gap: 0; height: calc(100vh - 290px); min-height: 520px; background: #fff; border: 1px solid var(--mc-gray-200); border-radius: 12px; overflow: hidden; }
.eng-inbox > div { min-height: 0; display: flex; flex-direction: column; }
.eng-inbox .pane-list { border-right: 1px solid var(--mc-gray-200); }
.eng-inbox .pane-info { border-left: 1px solid var(--mc-gray-200); overflow: auto; }
.eng-conv { padding: 10px 14px; border-bottom: 1px solid #eef1f6; cursor: pointer; }
.eng-conv:hover { background: #f7f9fd; } .eng-conv.active { background: #e9f1ff; }
.eng-conv.unread .eng-conv-name, .eng-conv.unread .eng-conv-subj { font-weight: 700; }
.eng-msg { max-width: 82%; padding: 10px 14px; border-radius: 12px; font-size: .9rem; white-space: pre-wrap; word-break: break-word; }
.eng-msg.in { background: #f1f4fa; align-self: flex-start; } .eng-msg.out { background: #e3eeff; align-self: flex-end; } .eng-msg.note { background: #fff7e0; border: 1px dashed #e8c766; align-self: center; max-width: 90%; }
.eng-ai-banner { background: #f4f0ff; border: 1px solid #ddd2ff; color: #5b3fc4; border-radius: 8px; padding: 6px 10px; font-size: .8rem; }
.eng-step { border: 1px solid var(--mc-gray-200); border-radius: 10px; background: #fff; }
.eng-step-dot { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 17px; flex: none; }
.eng-timeline { border-left: 2px solid #e5e9f2; margin-left: 14px; padding-left: 18px; }
.eng-timeline .item { position: relative; padding-bottom: 14px; }
.eng-timeline .item .dot { position: absolute; left: -33px; top: 0; width: 28px; height: 28px; border-radius: 50%; background: #e9f1ff; color: #488bfd; display: flex; align-items: center; justify-content: center; }
.eng-editor { min-height: 260px; max-height: 420px; overflow: auto; border: 1px solid #ced4da; border-radius: 0 0 6px 6px; padding: 12px; background: #fff; }
.eng-editor:focus { outline: 2px solid rgba(72,139,253,.35); }
.eng-toolbar { border: 1px solid #ced4da; border-bottom: 0; border-radius: 6px 6px 0 0; background: #f8f9fc; padding: 4px 6px; display: flex; flex-wrap: wrap; gap: 2px; }
.eng-toolbar .btn { padding: 2px 8px; }
.eng-preview { border: 1px solid #e3e7f0; border-radius: 8px; background: #fff; padding: 16px; overflow: auto; max-height: 420px; }
@media (max-width: 1200px) { .eng-inbox { grid-template-columns: 300px minmax(0, 1fr); } .eng-inbox .pane-info { display: none; } }
@media (max-width: 767px) { .eng-inbox { grid-template-columns: 1fr; height: auto; } .eng-inbox .pane-thread { display: none; } .eng-inbox.has-open .pane-list { display: none; } .eng-inbox.has-open .pane-thread { display: flex; min-height: 70vh; } }
#sideTabs .nav-link { color: #42526e; font-size: .85rem; padding: 6px 12px; }
#sideTabs .nav-link.active { color: #1f2937; font-weight: 600; }

/* contact workspace: email composer (bottom-right) and notes */
.cw-composer { position: fixed; right: 16px; bottom: 0; width: 420px; max-width: calc(100vw - 32px); background: var(--bs-body-bg, #fff); border: 1px solid rgba(0,0,0,.15); border-bottom: 0; border-radius: 10px 10px 0 0; box-shadow: 0 -4px 24px rgba(0,0,0,.18); z-index: 1060; }
.cw-composer-head { display: flex; align-items: center; background: #1C3988; color: #fff; padding: 8px 12px; border-radius: 10px 10px 0 0; }
.cw-composer.min .cw-composer-body { display: none; }
@media (max-width: 575.98px) { .cw-composer { right: 0; left: 0; width: auto; max-width: none; border-radius: 0; } }
.cw-note { border-left: 3px solid #d0d7e8; padding: 6px 10px; border-radius: 4px; cursor: text; }
.cw-note:hover, .cw-note:focus { background: rgba(28,57,136,.05); outline: 0; border-left-color: #1C3988; }
.cw-note.editing { cursor: default; background: rgba(28,57,136,.06); border-left-color: #1C3988; }
.cw-note .cw-hint { font-size: .72rem; color: #6c757d; }

/* contacts list: column resize handle */
.contacts-table th .col-resize { position: absolute; right: 0; top: 0; width: 6px; height: 100%; cursor: col-resize; }
.contacts-table th .col-resize:hover { background: rgba(28,57,136,.35); }
.contacts-table th[draggable="true"] { cursor: grab; }

/* asset library: thumbnails fill their box without stretching; the three-dot menu sits on the card corner */
.asset-card { position: relative; }
.asset-card .asset-menu { position: absolute; top: 6px; right: 6px; z-index: 3; opacity: 0; transition: opacity .12s; }
.asset-card:hover .asset-menu, .asset-card:focus-within .asset-menu, .asset-card .asset-menu[aria-expanded="true"] { opacity: 1; }
@media (hover: none) { .asset-card .asset-menu { opacity: 1; } }
.asset-thumb, .asset-thumb-lg { object-fit: contain; width: 100%; height: 100%; max-width: 100%; max-height: 100%; background: #f6f7fb; }
.asset-visual { display: flex; align-items: center; justify-content: center; overflow: hidden; }

/* Integrations catalog: uniform cards */
.int-card { border: 1px solid var(--bs-border-color, #e3e7f1); transition: box-shadow .12s, border-color .12s; }
.int-card:hover { box-shadow: 0 2px 10px rgba(20, 30, 60, .08); }
.int-ico { width: 36px; height: 36px; border-radius: 8px; background: #eef2ff; color: #3b5bdb; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.int-item[hidden], .int-group[hidden] { display: none !important; }
.int-card > .btn, .int-card > span > .btn { align-self: flex-start; }
.int-card > .btn + .btn, .int-card > .btn + span { margin-left: .5rem; }

.int-compact { cursor: pointer; }
.int-compact:hover { border-color: #b9c5f5; }
.int-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Notification center (header dropdown) */
.notif-wrap { position: relative; display: inline-flex; }
.notif-bell { background: none; border: 0; cursor: pointer; }
.notif-bell:focus-visible { outline: 2px solid #488BFD; outline-offset: 2px; }
.notif-panel { position: fixed; z-index: 1060; width: 400px; max-width: calc(100vw - 16px); max-height: min(580px, calc(100vh - 80px)); display: flex; flex-direction: column; background: #fff; border: 1px solid #dfe5f1; border-radius: 10px; box-shadow: 0 12px 32px rgba(28, 57, 136, .16); }
.notif-panel[hidden] { display: none; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 8px; }
.notif-title { display: flex; align-items: baseline; gap: 8px; color: #1C3988; }
.notif-unread-count { font-size: 12px; color: #5b6785; }
.notif-head .btn-link { color: #488BFD; text-decoration: none; font-size: 13px; }
.notif-head .btn-link:disabled { color: #98a2b8; }
.notif-tabs { display: flex; gap: 4px; padding: 0 10px 8px; border-bottom: 1px solid #e9eef7; }
.notif-tab { border: 0; background: none; padding: 5px 12px; border-radius: 999px; font-size: 13px; color: #5b6785; cursor: pointer; }
.notif-tab:hover { background: #F1F6FC; }
.notif-tab.active { background: #1C3988; color: #fff; }
.notif-tab:focus-visible, .notif-item-main:focus-visible, .notif-act:focus-visible { outline: 2px solid #488BFD; outline-offset: -2px; }
.notif-body { flex: 1 1 auto; overflow-y: auto; min-height: 160px; overscroll-behavior: contain; }
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-item { position: relative; display: flex; align-items: flex-start; border-bottom: 1px solid #eef2f9; background: #fff; }
.notif-item.unread { background: #EEF4FE; }
.notif-item.unread .notif-item-title { font-weight: 600; }
.notif-item-main { flex: 1; min-width: 0; display: flex; gap: 10px; text-align: left; border: 0; background: none; padding: 11px 6px 11px 14px; cursor: pointer; color: inherit; }
.notif-item-main:hover { background: rgba(72, 139, 253, .07); }
.notif-ico { flex: 0 0 34px; height: 34px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; background: #F1F6FC; color: #1C3988; }
.notif-item.prio-high .notif-ico { background: #fdecec; color: #c0392b; }
.notif-text { min-width: 0; flex: 1; }
.notif-item-title { font-size: 13.5px; color: #10142A; line-height: 1.3; overflow-wrap: anywhere; }
.notif-item-body { font-size: 12.5px; color: #5b6785; margin-top: 2px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif-item-time { font-size: 11.5px; color: #8591ab; margin-top: 3px; }
.notif-dot { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: #488BFD; margin-top: 6px; }
.notif-item:not(.unread) .notif-dot { visibility: hidden; }
.notif-actions { display: flex; flex-direction: column; padding: 6px 6px 6px 0; opacity: 0; transition: opacity .1s; }
.notif-item:hover .notif-actions, .notif-item:focus-within .notif-actions { opacity: 1; }
@media (hover: none) { .notif-actions { opacity: 1; } }
.notif-act { border: 0; background: none; width: 28px; height: 28px; border-radius: 6px; color: #5b6785; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.notif-act:hover { background: #e3ebfb; color: #1C3988; }
.notif-item.busy { opacity: .6; pointer-events: none; }
.notif-state { padding: 36px 20px; text-align: center; color: #5b6785; font-size: 13.5px; }
.notif-state i { font-size: 30px; color: #98a2b8; display: block; margin-bottom: 6px; }
.notif-skel { display: flex; gap: 10px; padding: 12px 14px; }
.notif-skel span { display: block; border-radius: 6px; background: linear-gradient(90deg, #eef2f9, #f6f8fc, #eef2f9); background-size: 200% 100%; animation: notifPulse 1.2s ease infinite; }
@keyframes notifPulse { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .notif-skel span { animation: none; } }
.notif-more { display: block; width: 100%; border: 0; background: #F1F6FC; padding: 9px; font-size: 13px; color: #1C3988; cursor: pointer; }
.notif-foot { display: flex; justify-content: space-between; padding: 9px 14px; border-top: 1px solid #e9eef7; font-size: 12.5px; }
.notif-foot a { color: #488BFD; text-decoration: none; }
.notif-foot a:hover { text-decoration: underline; }
@media (max-width: 575.98px) { .notif-panel { left: 8px !important; right: 8px !important; width: auto; top: 56px !important; max-height: calc(100vh - 72px); } }

/* Header profile menu */
.profile-menu { position: relative; display: inline-flex; margin-left: 4px; }
.profile-btn { display: inline-flex; align-items: center; gap: 2px; padding: 2px 4px 2px 2px; border: 1px solid transparent; border-radius: 999px; background: none; cursor: pointer; color: #5b6785; }
.profile-btn:hover, .profile-btn[aria-expanded="true"] { background: #F1F6FC; border-color: #dfe7f5; }
.profile-btn:focus-visible { outline: 2px solid #488BFD; outline-offset: 2px; }
.profile-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; }
.profile-initials { background: #e3eaf8; color: #1C3988; font-weight: 700; font-size: 14px; }
.profile-avatar-lg { width: 48px; height: 48px; font-size: 16px; }
.profile-caret { font-size: 16px; }
.profile-panel { width: 330px; max-width: calc(100vw - 16px); padding: 0; border: 1px solid #dfe5f1; border-radius: 10px; box-shadow: 0 12px 32px rgba(28, 57, 136, .16); overflow: hidden; }
.profile-id { display: flex; gap: 12px; align-items: center; padding: 14px 14px 12px; }
.profile-id-text { min-width: 0; }
.profile-name { font-weight: 600; color: #10142A; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-email { font-size: 12.5px; color: #5b6785; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-role { font-size: 12.5px; color: #1C3988; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-ws { display: flex; gap: 10px; align-items: center; padding: 10px 14px; background: #F1F6FC; border-top: 1px solid #e7edf8; border-bottom: 1px solid #e7edf8; }
.profile-ws-logo { width: 32px; height: 32px; border-radius: 8px; object-fit: contain; background: #fff; border: 1px solid #dfe7f5; flex: 0 0 auto; }
.profile-ws-fallback { display: inline-flex; align-items: center; justify-content: center; color: #1C3988; font-size: 18px; }
.profile-ws-name { font-weight: 600; font-size: 13.5px; color: #1C3988; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-links { padding: 6px; }
.profile-panel .dropdown-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; font-size: 14px; color: #10142A; }
.profile-panel .dropdown-item i { font-size: 18px; color: #5b6785; }
.profile-panel .dropdown-item:hover, .profile-panel .dropdown-item:focus { background: #F1F6FC; }
.profile-foot { padding: 6px; border-top: 1px solid #e7edf8; }
.profile-foot form { margin: 0; }
.profile-signout { width: 100%; background: none; border: 0; text-align: left; }
@media (max-width: 575.98px) { .profile-caret { display: none; } .profile-avatar { width: 36px; height: 36px; } }
.profile-panel { z-index: 1070; } /* above the MixAI panel (1045) and the notification panel (1060) */
.brand-swatch { display: inline-block; width: 18px; height: 18px; border-radius: 4px; border: 1px solid rgba(0,0,0,.18); vertical-align: middle; flex: 0 0 auto; }

/* Settings Center */
.settings-shell { display: flex; gap: 24px; align-items: flex-start; }
.settings-nav-wrap { flex: 0 0 230px; position: sticky; top: 12px; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; padding: 6px; background: #fff; border: 1px solid #dfe5f1; border-radius: 10px; }
.settings-nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; color: #10142A; font-size: 14px; text-decoration: none; }
.settings-nav a i { font-size: 18px; color: #5b6785; }
.settings-nav a:hover { background: #F1F6FC; }
.settings-nav a.active { background: #1C3988; color: #fff; }
.settings-nav a.active i { color: #fff; }
.settings-nav-home { border-bottom: 1px solid #eef2f9; border-radius: 6px 6px 0 0 !important; margin-bottom: 4px; }
.settings-content { flex: 1 1 auto; min-width: 0; }
.settings-search { position: relative; max-width: 560px; }
.settings-results { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid #dfe5f1; border-radius: 8px; box-shadow: 0 10px 28px rgba(28, 57, 136, .14); max-height: 380px; overflow-y: auto; }
.settings-result { display: block; padding: 9px 12px; text-decoration: none; color: #10142A; border-bottom: 1px solid #eef2f9; }
.settings-result:hover, .settings-result.is-active { background: #F1F6FC; }
.settings-result small { color: #5b6785; display: block; }
.settings-result mark { background: #dbe8ff; padding: 0; color: inherit; }
.settings-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.settings-cat { display: flex; gap: 12px; padding: 14px; background: #fff; border: 1px solid #dfe5f1; border-radius: 10px; text-decoration: none; color: inherit; }
.settings-cat:hover { border-color: #b9c5f5; }
.settings-cat-ico { flex: 0 0 38px; height: 38px; border-radius: 8px; background: #eef2ff; color: #1C3988; display: inline-flex; align-items: center; justify-content: center; font-size: 20px; }
.settings-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid #eef2f9; text-decoration: none; color: inherit; background: #fff; }
.settings-item:hover { background: #F1F6FC; }
.settings-item:last-child { border-bottom: 0; }
@media (max-width: 991.98px) {
  .settings-shell { flex-direction: column; gap: 12px; }
  .settings-nav-wrap { flex: none; position: static; width: 100%; }
  .settings-nav-toggle { display: flex; width: 100%; align-items: center; gap: 8px; padding: 9px 12px; background: #fff; border: 1px solid #dfe5f1; border-radius: 8px; cursor: pointer; font-weight: 600; color: #1C3988; }
  .settings-nav-wrap .settings-nav { margin-top: 6px; }
}
.settings-nav-sub { display: flex; flex-direction: column; margin: 0 0 4px 22px; border-left: 2px solid #e3eaf8; }
.settings-nav-sub a { padding: 6px 10px; font-size: 13px; color: #3a4a76; }
.settings-nav-sub a.active-sub { color: #1C3988; font-weight: 600; }

/* "Updated 10:42" + Refresh in the header */
.page-fresh { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: #5b6785; margin-right: 10px; white-space: nowrap; }
.page-fresh-btn { border: 0; background: none; width: 28px; height: 28px; border-radius: 6px; color: #3a4a76; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; cursor: pointer; }
.page-fresh-btn:hover { background: #e2eafa; }
.page-fresh-btn:focus-visible { outline: 2px solid #488BFD; outline-offset: 1px; }
.page-fresh.is-stale .page-fresh-text { color: #8a5a00; }
.page-fresh.is-loading .page-fresh-btn i { animation: pageFreshSpin .8s linear infinite; }
@keyframes pageFreshSpin { to { transform: rotate(360deg); } }
@media (max-width: 767.98px) { .page-fresh-text { display: none; } .page-fresh { margin-right: 4px; } }
@media (prefers-reduced-motion: reduce) { .page-fresh.is-loading .page-fresh-btn i { animation: none; } }

/* hover actions (call / message / mail / edit) beside phone and email in list rows */
td .cell-actions { display: inline-flex; gap: 2px; margin-left: 8px; vertical-align: middle; opacity: 0; transition: opacity .12s; }
tr:hover td .cell-actions, td .cell-actions:focus-within { opacity: 1; }
td:has(input, select) .cell-actions { display: none; }
td .cell-actions a, td .cell-actions button { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: 0; border-radius: 4px; background: transparent; color: var(--mc-gray-600, #6b7893); font-size: 15px; padding: 0; cursor: pointer; }
td .cell-actions a:hover, td .cell-actions button:hover { background: rgba(28, 57, 136, .1); color: #1c3988; }
@media (hover: none) { td .cell-actions { opacity: 1; } }

/* list filters: below 992px the quick filters sit behind a funnel button (badge = how many are active); desktop keeps them inline */
.fl-panel { display: contents; }
.fl-toggle { min-width: 38px; min-height: 34px; }
.fl-toggle[aria-expanded="true"] { background: rgba(28, 57, 136, .1); border-color: #1c3988; color: #1c3988; }
.fl-count { position: absolute; top: -6px; right: -6px; font-size: 10px; line-height: 1; padding: 3px 5px; }
@media (max-width: 991.98px) {
  .fl-panel { display: none; flex: 0 0 100%; order: 5; padding-top: .5rem; margin-top: .25rem; border-top: 1px solid var(--mc-gray-200, #e4e8f1); }
  .fl-panel.open { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
  .fl-panel .form-select { width: 100% !important; min-height: 40px; }
  .fl-panel .btn { min-height: 40px; }
  .fl-panel #btnClear { justify-self: start; }
  .fl-toggle { min-height: 38px; min-width: 40px; }
}
@media (max-width: 575.98px) {
  .fl-panel.open { grid-template-columns: 1fr; }
  #fSearch { min-width: 0; }
  .input-group:has(#fSearch) { flex: 1 1 0; max-width: none !important; }
}

/* lead lifecycle card: a stepper of the funnel stages, the current one filled */
.lc-steps { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 14px; }
.lc-steps li { flex: 1 1 90px; min-width: 90px; text-align: center; font-size: 12px; font-weight: 600; padding: 7px 8px; border-radius: 8px; background: var(--mc-gray-100, #eef1f7); color: var(--mc-gray-600, #6b7893); border: 1px solid transparent; }
.lc-steps li.done { background: rgba(25, 135, 84, .12); color: #146c43; }
.lc-steps li.current { background: #1c3988; color: #fff; }
.lc-card .lc-actions .btn { min-height: 34px; }
@media (max-width: 575.98px) { .lc-steps li { flex-basis: 45%; } .lc-card .lc-actions { width: 100%; } .lc-card .lc-actions .btn { flex: 1 1 auto; } }

/* bulk data operations: preview table values wrap, and the new value stands out */
#btModal .bt-val { max-width: 320px; word-break: break-word; }
#btModal .bt-after { background: rgba(25, 135, 84, .12); border-radius: 4px; padding: 1px 4px; }

/* contacts and leads: the table scrolls inside its own box, so the column headings stay in view while the rows scroll under them */
.table-sticky { max-height: calc(100vh - 250px); min-height: 260px; overflow: auto; }
.table-sticky > table > thead > tr > th { position: sticky !important; top: 0; z-index: 3; box-shadow: inset 0 -1px 0 var(--mc-gray-200); }
@media (max-width: 767.98px) { .table-sticky { max-height: calc(100vh - 170px); } }

/* list shortcuts: the lifecycle icons sit under the value; WhatsApp and the quick-email icon take their own colour on hover */
td .cell-actions.below { display: flex; margin: 3px 0 0; }
td .cell-actions .ca-yes:hover { color: #198754; background: rgba(25, 135, 84, .12); }
td .cell-actions .ca-no:hover { color: #dc3545; background: rgba(220, 53, 69, .12); }
td .cell-actions .ca-wa:hover { color: #1fa855; background: rgba(37, 211, 102, .15); }
td .cell-actions .ca-sms:hover { color: #0d6efd; background: rgba(13, 110, 253, .12); }
td.lc-edit { cursor: pointer; }
.lc-pop { position: absolute; z-index: 1085; }

/* bulk data operation running in the background (bottom left, above the toasts) */
.bt-track { position: fixed; left: 16px; bottom: 96px; z-index: 1080; width: 340px; max-width: calc(100vw - 32px); }

/* quick note box next to the note icon */
.qn-pop { position: absolute; z-index: 1085; }
.qn-pop .qn-prev { margin-top: 3px; padding: 4px 6px; background: var(--mc-gray-50, #f6f8fc); border-left: 3px solid var(--mc-gray-300, #d5d9e4); white-space: pre-wrap; max-height: 64px; overflow: hidden; font-size: 12px; }
td .cell-actions .ca-note:hover { color: #b7791f; background: rgba(241, 180, 52, .18); }

/* the logo and name at the top of the sidebar are a link to the home page */
a.sidebar-brand { color: inherit; text-decoration: none; }
a.sidebar-brand:hover, a.sidebar-brand:focus-visible { color: inherit; opacity: .9; }

/* Advanced filters: the builder modal and the active-filter chip in the lists */
.adv-btn .adv-count { margin-left: .25rem; }
.adv-chip { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: .5rem 0; padding: .35rem .6rem; border: 1px solid var(--bs-primary-border-subtle, #b6d4fe); background: var(--bs-primary-bg-subtle, #e7f1ff); border-radius: .5rem; font-size: .85rem; max-width: 100%; }
.adv-chip[hidden] { display: none; }
.adv-chip-text { min-width: 0; overflow-wrap: anywhere; }
.adv-group { border: 1px solid var(--bs-border-color); border-radius: .5rem; padding: .6rem; background: var(--bs-body-bg); }
.adv-group.adv-nested { margin: .35rem 0; background: var(--bs-tertiary-bg, #f8f9fa); border-left: 3px solid var(--bs-primary); }
.adv-group-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; flex-wrap: wrap; }
.adv-children { display: flex; flex-direction: column; gap: .4rem; }
.adv-cond { display: flex; gap: .4rem; align-items: flex-start; flex-wrap: wrap; }
.adv-cond .adv-field { flex: 1 1 190px; max-width: 260px; }
.adv-cond .adv-op { flex: 1 1 170px; max-width: 220px; }
.adv-cond .adv-val { flex: 2 1 220px; min-width: 0; }
.adv-cond .adv-val-group { flex-basis: 100%; }
.adv-sub { margin-top: .25rem; }
.adv-add { display: flex; gap: .4rem; margin-top: .5rem; }
.adv-empty { padding: .4rem; }
.adv-summary { padding: .75rem; border-radius: .5rem; background: var(--bs-tertiary-bg, #f8f9fa); }
.adv-menu { min-width: 280px; max-height: 60vh; overflow: auto; }
.adv-view { display: flex; align-items: center; gap: .35rem; padding: .35rem .5rem; border-radius: .35rem; }
.adv-view:hover { background: var(--bs-tertiary-bg, #f1f3f5); }
.adv-view-open { text-decoration: none; color: inherit; }
@media (max-width: 575.98px) { .adv-cond .adv-field, .adv-cond .adv-op { max-width: none; flex-basis: 100%; } }

/* ---- global search: progress, results with icons ---- */
.gs-spin { position: absolute; right: 12px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border: 2px solid var(--mc-gray-200); border-top-color: var(--mc-blue); border-radius: 50%; animation: gs-rot .7s linear infinite; pointer-events: none; }
.gs-spin[hidden], .gs-panel[hidden], .gs-status[hidden] { display: none; }
@keyframes gs-rot { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .gs-spin { animation-duration: 2s; } }
.gs-panel { position: absolute; top: calc(100% + 6px); left: 0; right: 0; min-width: 320px; z-index: 1080; background: #fff; border: 1px solid var(--mc-gray-200); border-radius: var(--r-md); box-shadow: 0 8px 24px rgba(16, 24, 40, .12); max-height: 70vh; overflow: auto; }
.gs-status { padding: 10px 14px; font-size: var(--fs-sm); color: var(--mc-gray-500); }
.gs-head { display: flex; align-items: center; gap: 8px; padding: 8px 14px 4px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--mc-gray-500); }
.gs-panel .gs-ico { position: static; transform: none; font-size: 18px; color: var(--mc-blue); flex: 0 0 auto; }
.gs-head .gs-ico { font-size: 14px; color: var(--mc-gray-400); }
.gs-item { display: flex; align-items: center; gap: 10px; padding: 8px 14px; color: inherit; text-decoration: none; border-left: 3px solid transparent; }
.gs-item:hover, .gs-item:focus { background: var(--mc-gray-50); border-left-color: var(--mc-blue); outline: none; }
.gs-text { display: flex; flex-direction: column; min-width: 0; font-size: var(--fs-sm); }
.gs-primary { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-muted { font-weight: 400; color: var(--mc-gray-500); }
.gs-second { font-size: 12px; color: var(--mc-gray-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- agreements: header, overview, mail ---- */
.ag-head { align-items: flex-start; gap: 16px 24px; }
.ag-head-main { flex: 1 1 340px; min-width: 0; }
.ag-title-row { display: flex; align-items: center; gap: 10px; }
.ag-title-ico { color: var(--mc-blue); font-size: 1.5rem; }
.ag-number { font-size: 1.5rem; font-weight: 700; margin: 0; color: var(--mc-ink); letter-spacing: -.01em; }
.page-header .ag-number > i { display: none; }
.ag-name { font-size: 1.05rem; font-weight: 600; color: var(--mc-gray-800); margin-top: 2px; line-height: 1.35; }
.ag-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 8px; font-size: var(--fs-sm); }
.ag-meta .badge { font-weight: 600; padding: .4em .65em; }
.ag-account { display: inline-flex; align-items: center; gap: 4px; color: var(--mc-gray-600); text-decoration: none; margin-right: 4px; }
a.ag-account:hover { color: var(--mc-blue); text-decoration: underline; }
.ag-actions { flex: 0 1 auto; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; max-width: 100%; }
@media (max-width: 991px) { .ag-actions { justify-content: flex-start; width: 100%; } }
.ag-card { box-shadow: 0 1px 3px rgba(16, 28, 72, .06); }
.ag-card h6 { display: flex; align-items: center; gap: 6px; font-weight: 700; margin-bottom: 10px; }
.ag-card h6 > i { color: var(--mc-blue); font-size: 1.1em; }
.ag-paper-wrap { background: #eef0f6; padding: 28px clamp(12px, 3vw, 36px); overflow: auto; }
.ag-paper { max-width: 900px; margin: 0 auto; background: #fff; border: 1px solid var(--mc-gray-200); border-radius: 8px; box-shadow: 0 6px 20px rgba(16, 28, 72, .08); overflow: hidden; }
.ag-facts th { width: 46%; font-weight: 500; padding-left: 0; }
.ag-facts td { font-weight: 600; text-align: right; }
.ag-facts tr:last-child > * { border-bottom: 0; }
.ag-side .card:last-child { margin-bottom: 0 !important; }
.ag-mail-row { padding: 14px 16px; }
.min-w-0 { min-width: 0; }

/* ---- AI assist panel: noticeable, explains itself ---- */
.ai-assist-hl { border: 1px solid #c9d2ff; border-left: 4px solid #6c5ce7; background: linear-gradient(135deg, #f6f7ff 0%, #fcf7ff 100%); box-shadow: 0 2px 8px rgba(108, 92, 231, .10); }
.ai-assist-hl .ai-spark { color: #6c5ce7; font-size: 1.35rem; }
.ai-badge { background: linear-gradient(90deg, #6c5ce7, #3b6fe0); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .06em; border-radius: 999px; padding: 2px 8px; }
.ai-intro { background: #fff; border: 1px dashed #b9c2f5; border-radius: 8px; padding: 10px 14px; margin-bottom: 10px; }
.ai-intro[hidden] { display: none; }
.ai-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ai-chip { border-radius: 999px; }
.ai-cta { background: linear-gradient(90deg, #6c5ce7, #3b6fe0); color: #fff; border: 0; }
.ai-cta:hover { color: #fff; filter: brightness(1.08); }

/* ---- agreement signature record ---- */
.ag-evidence { border: 1px solid var(--mc-gray-200); border-radius: 8px; background: var(--mc-gray-50); padding: 10px 12px; max-width: 460px; }
.ag-ev-head { font-weight: 700; font-size: 12px; color: var(--mc-gray-700); display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.ag-ev-head i { color: var(--mc-blue); }
.ag-sig-img { display: block; max-width: 220px; max-height: 80px; background: #fff; border: 1px solid var(--mc-gray-200); border-radius: 6px; padding: 4px; margin-bottom: 8px; }
.ag-ev-list { display: grid; grid-template-columns: 110px 1fr; gap: 2px 10px; margin: 0; font-size: 12px; }
.ag-ev-list dt { color: var(--mc-gray-500); font-weight: 500; }
.ag-ev-list dd { margin: 0; color: var(--mc-ink); font-weight: 600; overflow-wrap: anywhere; }
.ag-ev-note { margin-top: 6px; font-size: 11px; color: var(--mc-gray-500); }
/* signature picker (type / draw / upload) used by the sign and record dialogs */
.ag-sigpick .btn-group { width: 100%; }
.ag-sigpick canvas { width: 100%; max-width: 520px; height: auto; border: 1px solid var(--mc-gray-300, #cfd4dc); border-radius: 6px; background: #fff; touch-action: none; }
.ag-typed-preview { font-family: "Brush Script MT", "Segoe Script", cursive; font-size: 28px; padding: 6px 12px; border: 1px dashed var(--mc-gray-300, #cfd4dc); border-radius: 6px; background: #fff; min-height: 52px; }
