@charset "UTF-8";

:root {
  --teal: #00bcd4;
  --teal-dark: #008fa3;
  --teal-deep: #006b79;
  --teal-pale: #e8fbfd;
  --green: #23d4b1;
  --ink: #16343b;
  --ink-2: #36545b;
  --muted: #72878c;
  --line: #dfeaec;
  --surface: #fff;
  --canvas: #f5f9fa;
  --danger: #e5484d;
  --success: #0fa76f;
  --warning: #e99a13;
  --blue: #3589e8;
  --purple: #7968e8;
  --shadow: 0 12px 32px rgba(18, 54, 62, .07);
  --radius: 16px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--canvas); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--teal-dark); text-decoration: none; }
button { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, strong { letter-spacing: -.018em; }
small { color: var(--muted); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 999; padding: 10px 14px; color: #fff; background: var(--teal-deep); border-radius: 8px; }
.skip-link:focus { top: 12px; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.content { min-width: 0; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 24px 16px 16px; color: #d8eef1; background: linear-gradient(180deg, #13363d 0%, #0e2c32 100%); z-index: 20; }
.brand { display: flex; align-items: center; gap: 11px; font-size: 18px; font-weight: 800; letter-spacing: -.02em; color: #fff; }
.sidebar .brand { padding: 0 10px 28px; }
.brand-mark { width: 33px; height: 33px; display: inline-grid; place-items: center; border-radius: 10px; color: #fff; background: var(--teal); font-size: 18px; font-weight: 900; box-shadow: 0 7px 18px rgba(0, 188, 212, .28); }
.sidebar nav { display: flex; flex: 1; flex-direction: column; gap: 4px; overflow-y: auto; }
.nav-item { position: relative; display: flex; align-items: center; min-height: 43px; gap: 12px; padding: 9px 12px; border-radius: 10px; color: #a9c4c9; font-weight: 620; transition: .18s ease; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.055); }
.nav-item.active { color: #fff; background: rgba(0,188,212,.16); box-shadow: inset 3px 0 0 var(--teal); }
.nav-icon { position: relative; width: 19px; height: 19px; flex: 0 0 19px; color: currentColor; }
.nav-icon::before, .nav-icon::after { content: ""; position: absolute; box-sizing: border-box; }
.nav-icon[data-icon="grid"]::before { left: 2px; top: 2px; width: 15px; height: 15px; background: linear-gradient(currentColor 0 0) 0 0 / 6px 6px no-repeat, linear-gradient(currentColor 0 0) 9px 0 / 6px 6px no-repeat, linear-gradient(currentColor 0 0) 0 9px / 6px 6px no-repeat, linear-gradient(currentColor 0 0) 9px 9px / 6px 6px no-repeat; border-radius: 2px; }
.nav-icon[data-icon="users"]::before, .nav-icon[data-icon="team"]::before, .nav-icon[data-icon="person"]::before { left: 6px; top: 1px; width: 7px; height: 7px; border: 1.7px solid currentColor; border-radius: 50%; }
.nav-icon[data-icon="users"]::after, .nav-icon[data-icon="team"]::after, .nav-icon[data-icon="person"]::after { left: 2px; bottom: 1px; width: 15px; height: 8px; border: 1.7px solid currentColor; border-bottom: 0; border-radius: 9px 9px 2px 2px; }
.nav-icon[data-icon="route"]::before { left: 2px; top: 5px; width: 14px; height: 9px; border-top: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor; }
.nav-icon[data-icon="route"]::after { right: 1px; top: 2px; width: 6px; height: 6px; border-top: 1.8px solid currentColor; border-right: 1.8px solid currentColor; transform: rotate(45deg); }
.nav-icon[data-icon="return"]::before { left: 4px; top: 4px; width: 13px; height: 12px; border: 1.8px solid currentColor; border-left: 0; border-radius: 0 7px 7px 0; }
.nav-icon[data-icon="return"]::after { left: 1px; top: 2px; width: 7px; height: 7px; border-left: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor; transform: rotate(45deg); }
.nav-icon[data-icon="tag"]::before { left: 3px; top: 4px; width: 13px; height: 11px; border: 1.8px solid currentColor; border-radius: 3px 5px 5px 3px; transform: rotate(-35deg); }
.nav-icon[data-icon="tag"]::after { left: 6px; top: 6px; width: 3px; height: 3px; background: currentColor; border-radius: 50%; }
.nav-icon[data-icon="chart"]::before { left: 2px; bottom: 2px; width: 4px; height: 8px; background: currentColor; border-radius: 1px; box-shadow: 6px -4px 0 currentColor, 12px -8px 0 currentColor; }
.nav-icon[data-icon="message"]::before { left: 2px; top: 3px; width: 15px; height: 12px; border: 1.7px solid currentColor; border-radius: 3px; }
.nav-icon[data-icon="message"]::after { left: 5px; top: 4px; width: 9px; height: 9px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.nav-icon[data-icon="bell"]::before { left: 4px; top: 2px; width: 11px; height: 13px; border: 1.7px solid currentColor; border-bottom: 0; border-radius: 8px 8px 2px 2px; }
.nav-icon[data-icon="bell"]::after { left: 3px; bottom: 1px; width: 13px; height: 3px; border-top: 1.7px solid currentColor; border-bottom: 1.7px solid currentColor; border-radius: 2px; }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 5px; border-radius: 20px; color: #fff; background: var(--teal); font-size: 10px; }
.sidebar-user { display: grid; grid-template-columns: 34px 1fr 24px; align-items: center; gap: 10px; padding: 15px 9px 2px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-user:hover { background: rgba(255,255,255,.045); border-radius: 10px; }
.sidebar-user .avatar, .top-avatar { display: grid; place-items: center; border-radius: 50%; color: var(--teal-deep); background: #c9f7fc; font-weight: 800; }
.sidebar-user .avatar { width: 34px; height: 34px; font-size: 11px; }
.sidebar-user strong, .sidebar-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user strong { color: #fff; font-size: 12px; }
.sidebar-user small { color: #81a3a9; font-size: 10px; }
.logout { color: #87a9ae; font-size: 16px; }
.topbar { height: 66px; display: flex; align-items: center; padding: 0 34px; background: rgba(255,255,255,.88); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 10; }
.topbar-spacer { flex: 1; }
.top-alert { position: relative; width: 36px; height: 36px; display: grid; place-items: center; margin-right: 9px; color: var(--teal); background: var(--teal-pale); border-radius: 50%; font-size: 10px; }
.top-alert span { position: absolute; right: -2px; top: -2px; min-width: 17px; height: 17px; padding: 0 4px; display: grid; place-items: center; color: #fff; background: var(--danger); border: 2px solid #fff; border-radius: 12px; font-size: 8px; font-weight: 800; }
.top-avatar { width: 35px; height: 35px; font-size: 11px; border: 0; cursor: pointer; }
.account-menu { position: relative; }
.account-dropdown { position: absolute; right: 0; top: 43px; width: 145px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 16px 40px rgba(12,45,52,.16); }
.account-dropdown a { display: block; padding: 9px 10px; color: var(--ink-2); border-radius: 7px; font-size: 12px; font-weight: 680; }
.account-dropdown a:hover { background: var(--teal-pale); color: var(--teal-deep); }
.menu-button { display: none !important; flex-direction: column; gap: 4px; }
.menu-button span { width: 18px; height: 2px; border-radius: 2px; background: var(--ink); }
.main { width: 100%; max-width: 1600px; margin: 0 auto; padding: 29px 34px 50px; }
.page-heading { min-height: 60px; margin-bottom: 24px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.page-heading h1 { margin-bottom: 5px; font-size: clamp(24px, 2.3vw, 31px); line-height: 1.15; }
.page-heading p { margin: 0; color: var(--muted); font-size: 14px; }

.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 15px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-weight: 720; font-size: 13px; transition: transform .12s ease, background .16s ease, border .16s ease, box-shadow .16s ease; }
.button:active { transform: translateY(1px); }
.button.primary { color: #fff; background: linear-gradient(110deg, var(--teal), var(--green)); box-shadow: 0 7px 16px rgba(0,188,212,.22); }
.button.primary:hover { filter: saturate(1.08) brightness(.97); }
.button.primary.is-muted { color: #f8ffff; background: #9dbdc1; box-shadow: none; }
.button.secondary { border-color: #cde2e5; color: var(--teal-deep); background: #f8fcfc; }
.button.secondary:hover, .button.ghost:hover { background: var(--teal-pale); }
.button.ghost { border-color: transparent; color: var(--ink-2); background: transparent; }
.button.danger-button, .danger-button { color: #fff; background: var(--danger); }
.button.success-button { color: #fff; background: var(--success); }
.button.danger-link { color: var(--danger); background: #fff7f7; border-color: #f7d8da; }
.button.tiny { min-height: 31px; padding: 5px 9px; font-size: 11px; }
.button.wide { width: 100%; }
.button.align-start { align-self: flex-start; }
.icon-button { width: 36px; height: 36px; display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: 9px; cursor: pointer; color: var(--ink-2); background: transparent; }
.icon-button:hover { background: #eef6f7; }

.alert { display: flex; align-items: center; gap: 11px; margin: -8px 0 20px; padding: 12px 15px; border-radius: 10px; }
.alert > span { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; font-weight: 900; }
.alert p { margin: 0; }
.alert.success { color: #09734f; background: #eaf9f3; border: 1px solid #cdeee2; }
.alert.success > span { color: #fff; background: var(--success); }
.alert.error { color: #9d3136; background: #fff1f1; border: 1px solid #f6d3d5; }
.alert.error > span { color: #fff; background: var(--danger); }
.attention-banner { margin-bottom: 18px; display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 14px; padding: 15px 18px; border: 1px solid #f0dfb8; border-radius: 13px; background: #fffaf0; }
.attention-banner.danger { border-color: #f4cccf; background: #fff5f5; }
.attention-icon { width: 40px; height: 40px; display: grid; place-items: center; color: #fff; background: var(--warning); border-radius: 11px; font-weight: 900; }
.attention-banner.danger .attention-icon { background: var(--danger); }
.attention-banner strong { font-size: 14px; }
.attention-banner p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }

.panel, .stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { overflow: hidden; }
.panel-heading { min-height: 72px; padding: 19px 22px; display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; border-bottom: 1px solid #edf2f3; }
.panel-heading h2 { margin-bottom: 2px; font-size: 16px; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.panel-heading > a { margin-top: 3px; font-size: 12px; font-weight: 700; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 18px; }
.stat-card { min-height: 124px; padding: 21px 18px; display: flex; align-items: center; gap: 14px; }
.stat-icon { flex: 0 0 auto; width: 43px; height: 43px; display: grid; place-items: center; border-radius: 12px; font-size: 18px; font-weight: 800; }
.stat-icon.teal { color: var(--teal-dark); background: var(--teal-pale); }
.stat-icon.blue { color: var(--blue); background: #edf5ff; }
.stat-icon.purple { color: var(--purple); background: #f2f0ff; }
.stat-icon.green { color: var(--success); background: #e9f9f3; }
.status-stat .stat-icon i { width: 13px; height: 13px; background: currentColor; border: 3px solid rgba(255,255,255,.9); border-radius: 50%; box-shadow: 0 0 0 3px currentColor; }
.status-stat strong { font-size: 18px; }
.stat-card p { margin: 0; color: var(--muted); font-size: 12px; font-weight: 650; }
.stat-card strong { display: block; margin-top: 2px; font-size: 25px; line-height: 1.2; }
.stat-card small { display: block; margin-top: 4px; font-size: 10px; }
.quick-alerts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; margin-bottom: 18px; }
.quick-alerts a { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 13px; padding: 14px 16px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); }
.quick-alerts a > span:nth-child(2) strong, .quick-alerts a > span:nth-child(2) small { display: block; }
.quick-alerts a b { color: var(--teal-dark); }
.quick-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; font-size: 18px; }
.quick-icon.amber { color: #b56f00; background: #fff5db; }
.quick-icon.teal { color: var(--teal-dark); background: var(--teal-pale); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(340px, .9fr); gap: 18px; margin-bottom: 18px; }
.pipeline-list { padding: 10px 22px 17px; }
.pipeline-row { min-height: 43px; display: grid; grid-template-columns: 9px 135px minmax(60px, 1fr) 34px; align-items: center; gap: 10px; color: var(--ink-2); }
.pipeline-dot { width: 7px; height: 7px; border-radius: 50%; }
.pipeline-label { font-size: 12px; }
.pipeline-track { height: 6px; overflow: hidden; background: #edf3f4; border-radius: 10px; }
.pipeline-track i { display: block; min-width: 2px; height: 100%; border-radius: inherit; }
.pipeline-row strong { text-align: right; font-size: 12px; }
.activity-list { padding: 6px 9px; }
.activity-item { width: 100%; min-height: 58px; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; text-align: left; border: 0; border-radius: 9px; background: transparent; cursor: pointer; }
.activity-item:hover { background: #f5fafb; }
.activity-icon { width: 32px; height: 32px; display: grid; place-items: center; color: var(--teal-dark); background: var(--teal-pale); border-radius: 9px; font-weight: 800; }
.activity-item strong, .activity-item small { display: block; }
.activity-item strong { font-size: 12px; }
.activity-item small { font-size: 10px; }
.activity-item time { color: var(--muted); font-size: 10px; }
.recent-panel { margin-bottom: 20px; }

.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.data-table th { height: 42px; padding: 10px 15px; text-align: left; color: var(--muted); background: #fbfdfd; border-bottom: 1px solid var(--line); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.data-table td { height: 68px; padding: 10px 15px; border-bottom: 1px solid #edf2f3; color: var(--ink-2); font-size: 12px; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr[data-lead] { cursor: pointer; transition: background .14s; }
.data-table tbody tr[data-lead]:hover, .data-table tbody tr[data-lead]:focus { outline: 0; background: #f8fcfc; }
.data-table td > strong, .data-table td > small { display: block; }
.person-cell { display: flex; align-items: center; gap: 10px; }
.person-cell strong, .person-cell small { display: block; }
.person-cell strong { color: var(--ink); font-size: 12px; }
.person-cell small { margin-top: 2px; font-size: 10px; }
.lead-avatar { flex: 0 0 auto; width: 36px; height: 36px; display: grid; place-items: center; color: var(--teal-deep); background: linear-gradient(145deg, #d8fafd, #bceff4); border-radius: 10px; font-size: 10px; font-weight: 850; }
.contact-phone { color: var(--ink); }
.status-pill { --status: var(--teal); display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; color: var(--ink-2); background: color-mix(in srgb, var(--status) 10%, white); border-radius: 20px; font-size: 10px; font-weight: 700; }
.status-pill i { width: 6px; height: 6px; background: var(--status); border-radius: 50%; }
.label-cell { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.label-chip, .label-preview { --label: var(--teal); display: inline-flex; align-items: center; max-width: 150px; overflow: hidden; text-overflow: ellipsis; padding: 4px 8px; border-radius: 5px; color: color-mix(in srgb, var(--label) 52%, #112b31); background: color-mix(in srgb, var(--label) 14%, white); border: 1px solid color-mix(in srgb, var(--label) 27%, white); font-size: 9px; font-weight: 750; }
.more-labels { color: var(--muted); font-size: 9px; }
.row-arrow { width: 29px; height: 29px; display: grid; place-items: center; border: 0; border-radius: 50%; color: var(--teal-dark); background: var(--teal-pale); cursor: pointer; }
.role-pill, .account-state { display: inline-flex; padding: 5px 8px; border-radius: 6px; font-size: 9px; font-weight: 750; }
.role-pill.agent { color: #256da7; background: #edf6ff; }
.role-pill.manager { color: #7659bb; background: #f3efff; }
.role-pill.admin { color: #b16b00; background: #fff5df; }
.account-state.active { color: #087550; background: #eaf9f3; }
.account-state.suspended { color: #a7353b; background: #fff0f1; }
.routing-state { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 720; }
.routing-state i { width: 7px; height: 7px; background: #aebdc0; border-radius: 50%; }
.routing-state.enabled { color: #087550; }
.routing-state.enabled i { background: var(--success); box-shadow: 0 0 0 3px rgba(15,167,111,.12); }
.table-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.mini-pipeline { display: flex; gap: 3px; margin-top: 4px; }
.mini-pipeline i { padding: 2px 4px; color: var(--muted); background: #eef4f5; border-radius: 4px; font-size: 7px; font-style: normal; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.pagination { min-height: 62px; display: flex; align-items: center; justify-content: center; gap: 20px; padding: 12px; border-top: 1px solid var(--line); font-size: 12px; }
.pagination a { font-weight: 700; }
.pagination span { color: var(--muted); }
.empty-state { min-height: 220px; padding: 35px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.empty-state > span { width: 50px; height: 50px; display: grid; place-items: center; margin-bottom: 12px; color: var(--teal-dark); background: var(--teal-pale); border-radius: 14px; font-size: 22px; }
.empty-state h3 { margin-bottom: 5px; font-size: 16px; }
.empty-state p { max-width: 350px; margin: 0; color: var(--muted); font-size: 12px; }

.filter-panel { margin-bottom: 16px; overflow: visible; }
.filters { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; padding: 14px; }
.filters > label:not(.search-field) { min-width: 130px; }
.filters label > span { display: block; margin: 0 0 4px 2px; color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.lead-filter-form { display: block; }
.filter-primary-row { display: flex; align-items: end; gap: 10px; }
.filter-primary-row .search-field { display: block; }
.advanced-filters { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); align-items: end; gap: 10px; padding-top: 12px; border-top: 1px solid #edf2f3; margin-top: 12px; }
.advanced-filters > label, .filter-field { min-width: 0; }
.filter-field { position: relative; color: var(--ink-2); font-size: 12px; font-weight: 650; }
.filter-field > span { display: block; margin: 0 0 4px 2px; color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.more-filters-button i { width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .18s ease; }
.more-filters-button.open i { transform: rotate(225deg) translate(-1px, -1px); }
.multi-filter { position: relative; }
.multi-filter summary { min-height: 40px; display: flex; align-items: center; justify-content: space-between; padding: 9px 32px 9px 11px; color: var(--ink); background: #fff; border: 1px solid #cfdee1; border-radius: 8px; cursor: pointer; list-style: none; font-weight: 450; }
.multi-filter summary::-webkit-details-marker { display: none; }
.multi-filter summary::after { content: ""; position: absolute; right: 13px; top: 15px; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); }
.multi-filter[open] summary { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0,188,212,.12); }
.multi-filter[open] summary::after { top: 18px; transform: rotate(225deg); }
.multi-filter-menu { position: absolute; z-index: 30; left: 0; top: calc(100% + 6px); min-width: 100%; width: max-content; max-width: 290px; max-height: 280px; overflow-y: auto; padding: 7px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 15px 35px rgba(12,45,52,.17); }
.multi-filter-menu label { min-height: 34px; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; white-space: nowrap; cursor: pointer; }
.multi-filter-menu label:hover { background: var(--teal-pale); }
.multi-filter-menu input { width: 16px; min-height: 16px; margin: 0; }
.multi-filter-menu label > span { margin: 0; color: var(--ink-2); font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.align-self-end { align-self: end; }
.search-field { min-width: 220px; flex: 1; position: relative; }
.search-field > span { position: absolute; left: 12px; bottom: 10px; color: var(--muted); font-size: 18px; }
.search-field input { padding-left: 35px; }
input, select, textarea { width: 100%; min-height: 40px; padding: 9px 11px; color: var(--ink); background: #fff; border: 1px solid #cfdee1; border-radius: 8px; outline: none; transition: border .15s, box-shadow .15s; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0,188,212,.12); }
label { color: var(--ink-2); font-size: 12px; font-weight: 650; }
label small { display: inline-block; margin-top: 4px; font-size: 9px; font-weight: 450; }

.routing-summary { display: grid; grid-template-columns: 180px 180px 1fr; align-items: center; gap: 20px; margin-bottom: 18px; padding: 17px 20px; color: var(--ink-2); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.routing-summary > div { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 3px 10px; }
.routing-summary > div strong { grid-row: 1 / 3; grid-column: 2; font-size: 25px; }
.routing-summary > div small { grid-column: 1; font-size: 9px; }
.routing-summary p { margin: 0; padding-left: 20px; border-left: 1px solid var(--line); font-size: 11px; }
.routing-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.routing-card { padding: 19px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.routing-card-top { display: grid; grid-template-columns: 39px 1fr auto; gap: 10px; align-items: center; margin-bottom: 15px; }
.routing-card-top h3 { margin: 0; font-size: 14px; }
.routing-card-top p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.routing-reason { display: flex; justify-content: space-between; gap: 15px; margin: 0 -19px; padding: 10px 19px; color: var(--muted); background: #f8fbfb; border-block: 1px solid #edf2f3; font-size: 10px; }
.routing-reason strong { color: var(--ink-2); text-align: right; }
.order-progress { padding: 16px 0 12px; }
.order-progress > div:first-child { display: flex; justify-content: space-between; margin-bottom: 7px; font-size: 10px; }
.progress { height: 7px; overflow: hidden; background: #eaf2f3; border-radius: 10px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), #23d4b1); border-radius: inherit; }
.routing-metrics { display: grid; grid-template-columns: repeat(4, 1fr); padding: 12px 0; border-top: 1px solid #edf2f3; }
.routing-metrics span { text-align: center; border-right: 1px solid #edf2f3; }
.routing-metrics span:last-child { border: 0; }
.routing-metrics strong, .routing-metrics small { display: block; }
.routing-metrics strong { font-size: 15px; }
.routing-metrics small { margin-top: 2px; font-size: 8px; text-transform: uppercase; letter-spacing: .04em; }
.routing-actions { display: flex; gap: 8px; padding-top: 11px; }
.routing-actions .button { flex: 1; }

.tab-row { display: flex; gap: 4px; margin-bottom: 13px; }
.tab { padding: 8px 12px; color: var(--muted); border-radius: 8px; font-size: 12px; font-weight: 700; }
.tab.active { color: var(--teal-deep); background: var(--teal-pale); }
.tab b { display: inline-grid; min-width: 18px; height: 18px; place-items: center; margin-left: 4px; background: rgba(0,0,0,.05); border-radius: 10px; font-size: 9px; }
.return-list { padding: 4px 16px; }
.return-item { min-height: 77px; display: grid; grid-template-columns: minmax(200px, 1.25fr) repeat(3, minmax(100px, .65fr)) 80px auto; align-items: center; gap: 12px; padding: 12px 5px; border-bottom: 1px solid #edf2f3; }
.return-item:last-child { border: 0; }
.return-item > span small, .return-item > span strong { display: block; }
.return-item > span small { margin-bottom: 2px; font-size: 8px; text-transform: uppercase; letter-spacing: .04em; }
.return-item > span strong { font-size: 10px; }
.return-lead { display: flex; align-items: center; gap: 10px; text-align: left; border: 0; background: transparent; cursor: pointer; }
.return-lead strong, .return-lead small { display: block; }
.return-lead small { font-size: 9px; }
.return-status { justify-self: start; padding: 5px 8px; border-radius: 5px; font-size: 9px !important; font-weight: 750; }
.return-status.pending { color: #a36300; background: #fff5df; }
.return-status.accepted { color: #087550; background: #eaf9f3; }
.return-status.rejected { color: #a7353b; background: #fff0f1; }
.return-item.accepted, .return-item.rejected { opacity: .72; }

.label-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 18px; }
.label-card { min-height: 84px; display: grid; grid-template-columns: auto 1fr 36px; align-items: center; gap: 13px; padding: 14px; background: #fbfdfd; border: 1px solid #e4edef; border-radius: 12px; }
.label-preview { padding: 8px 11px; font-size: 11px; }
.label-card strong, .label-card small { display: block; }

.notification-panel { padding: 7px 18px; }
.notification-item { display: grid; grid-template-columns: 40px 1fr 36px; gap: 13px; align-items: start; padding: 17px 5px; border-bottom: 1px solid #edf2f3; }
.notification-item:last-child { border-bottom: 0; }
.notification-item.unread { background: linear-gradient(90deg, rgba(0,188,212,.045), transparent); }
.notification-glyph { width: 38px; height: 38px; display: grid; place-items: center; color: var(--teal-dark); background: var(--teal-pale); border-radius: 11px; font-size: 16px; font-weight: 800; }
.notification-item > div > div { display: flex; justify-content: space-between; gap: 10px; }
.notification-item strong { font-size: 13px; }
.notification-item time { color: var(--muted); font-size: 9px; }
.notification-item p { margin: 4px 0 6px; color: var(--ink-2); font-size: 11px; }
.notification-item a { font-size: 10px; font-weight: 700; }
.email-log-panel { margin-top: 18px; }
.email-status { display: inline-flex; padding: 4px 7px; border-radius: 6px; font-size: 9px; font-weight: 750; }
.email-status.sent { color: #087550; background: #eaf9f3; }
.email-status.failed { color: #a5353b; background: #fff0f1; }
.email-status.queued, .email-status.processing { color: #8b620a; background: #fff5dd; }
.email-detail { max-width: 380px; overflow: hidden; text-overflow: ellipsis; }
.report-stats { margin-bottom: 18px; }
.conversion { width: 55px; height: 5px; display: inline-block; margin-right: 6px; overflow: hidden; vertical-align: middle; background: #e9f1f2; border-radius: 5px; }
.conversion i { display: block; height: 100%; background: var(--success); }
.profile-grid { display: grid; grid-template-columns: 280px minmax(0, 680px); gap: 18px; }
.profile-summary { padding: 28px 24px; text-align: center; }
.profile-avatar { width: 78px; height: 78px; display: grid; place-items: center; margin: 0 auto 13px; color: var(--teal-deep); background: linear-gradient(145deg, #d9fbfe, #aeeaf0); border-radius: 22px; font-size: 22px; font-weight: 850; }
.profile-summary h2 { margin-bottom: 8px; font-size: 19px; }
.profile-summary dl { margin: 25px 0 0; text-align: left; }
.profile-summary dl div { display: flex; justify-content: space-between; padding: 11px 0; border-top: 1px solid #edf2f3; }
.profile-summary dt { color: var(--muted); }
.profile-summary dd { margin: 0; font-weight: 700; }
.profile-form form { padding: 20px 22px 24px; }

.modal { width: min(680px, calc(100vw - 30px)); max-height: min(90vh, 900px); padding: 0; color: var(--ink); background: #fff; border: 0; border-radius: 18px; box-shadow: 0 30px 90px rgba(8,33,39,.28); overflow: hidden; }
.modal::backdrop { background: rgba(7,30,36,.55); backdrop-filter: blur(3px); }
.small-modal { width: min(520px, calc(100vw - 30px)); }
.modal > form, .modal:not(.lead-modal) { overflow-y: auto; }
.modal-header { min-height: 82px; display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 20px 23px 16px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 2px 0 0; font-size: 20px; }
.eyebrow { color: var(--teal-dark); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; }
.modal-close { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border: 0; border-radius: 50%; color: var(--muted); background: #f0f5f6; cursor: pointer; font-size: 23px; line-height: 1; }
.modal-body { padding: 20px 23px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 23px 18px; border-top: 1px solid var(--line); }
.form-stack { display: flex; flex-direction: column; gap: 13px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-section { padding: 14px; background: #f8fbfb; border: 1px solid #e7eff0; border-radius: 11px; }
.form-section h3 { margin-bottom: 11px; font-size: 12px; }
.range-field { --range-start: 0%; --range-end: 100%; margin-top: 15px; }
.range-field > div:first-child { display: flex; justify-content: space-between; gap: 15px; margin-bottom: 12px; color: var(--ink-2); font-size: 11px; font-weight: 700; }
.range-field output { color: var(--teal-deep); font-size: 10px; }
.dual-range { position: relative; height: 22px; background: linear-gradient(to right, #dbe7e9 var(--range-start), var(--teal) var(--range-start), var(--teal) var(--range-end), #dbe7e9 var(--range-end)); background-size: 100% 5px; background-position: center; background-repeat: no-repeat; border-radius: 10px; }
.dual-range input[type="range"] { position: absolute; inset: 0; height: 22px; min-height: 0; padding: 0; margin: 0; background: transparent; border: 0; box-shadow: none; appearance: none; pointer-events: none; }
.dual-range input[type="range"]::-webkit-slider-thumb { width: 18px; height: 18px; appearance: none; pointer-events: auto; background: #fff; border: 5px solid var(--teal); border-radius: 50%; box-shadow: 0 2px 7px rgba(12,72,82,.2); cursor: grab; }
.dual-range input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; pointer-events: auto; background: #fff; border: 5px solid var(--teal); border-radius: 50%; box-shadow: 0 2px 7px rgba(12,72,82,.2); cursor: grab; }
.dual-range input[type="range"]::-webkit-slider-runnable-track { background: transparent; }
.dual-range input[type="range"]::-moz-range-track { background: transparent; }
.form-help { margin: 0; color: var(--muted); font-size: 10px; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #f8fbfb; border: 1px solid #e4edef; border-radius: 9px; }
.check-row input, .check-inline input { width: 16px; min-height: 16px; accent-color: var(--teal); }
.check-row strong, .check-row small { display: block; }
.danger-zone { display: flex; justify-content: space-between; gap: 10px; padding: 14px 23px; background: #fff8f8; border-top: 1px solid #f3dfe0; }
.inline-warning { padding: 12px; color: #805200; background: #fff8e9; border: 1px solid #f0dfb5; border-radius: 9px; }
.inline-warning p { margin: 3px 0 9px; font-size: 10px; }
.colour-input { height: 46px; padding: 5px; cursor: pointer; }
.return-evidence { padding: 15px; background: #f8fbfb; border: 1px solid #e5edef; border-radius: 11px; }
.return-evidence span, .return-evidence strong { display: block; }
.return-evidence span { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.return-evidence p { margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; white-space: normal; }
.decision-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 15px; }
.decision-card { display: flex; flex-direction: column; gap: 10px; padding: 15px; border: 1px solid var(--line); border-radius: 11px; }
.decision-card h3 { margin: 0; font-size: 14px; }
.decision-card p { margin: 0; min-height: 38px; color: var(--muted); font-size: 10px; }

.lead-modal { width: min(930px, calc(100vw - 24px)); height: min(86vh, 820px); }
.lead-modal[open] { display: flex; flex-direction: column; }
.lead-modal-header { flex: 0 0 auto; }
.lead-modal-tabs { display: flex; gap: 3px; padding: 0 23px; border-bottom: 1px solid var(--line); }
.lead-modal-tabs button { padding: 12px 13px 10px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; cursor: pointer; font-size: 11px; font-weight: 750; }
.lead-modal-tabs button.active { color: var(--teal-deep); border-color: var(--teal); }
#lead-modal-content { min-height: 0; flex: 1; overflow-y: auto; }
.modal-loading { flex: 1; display: grid; place-items: center; align-content: center; gap: 12px; color: var(--muted); }
.modal-loading span { width: 34px; height: 34px; border: 3px solid #dcebed; border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.lead-overview { display: grid; grid-template-columns: minmax(0, 1fr) 290px; min-height: 100%; }
.lead-data { padding: 21px 23px 30px; }
.lead-actions { padding: 18px; background: #f7fbfb; border-left: 1px solid var(--line); }
.data-section { margin-bottom: 24px; }
.data-section h3 { margin-bottom: 10px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.data-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.data-point { min-height: 61px; padding: 11px 13px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.data-point span, .data-point strong { display: block; }
.data-point span { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .05em; }
.data-point strong { margin-top: 3px; overflow-wrap: anywhere; font-size: 11px; }
.action-block { display: flex; flex-direction: column; gap: 8px; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.field-label { color: var(--ink-2); font-size: 11px; font-weight: 700; }
.label-options { display: flex; flex-wrap: wrap; gap: 6px; }
.label-options label { cursor: pointer; }
.label-options input { position: absolute; opacity: 0; pointer-events: none; }
.label-options input:not(:checked) + .label-chip { filter: grayscale(.8); opacity: .42; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; background: #eaf2f3; border-radius: 8px; }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: grid; place-items: center; min-height: 29px; border-radius: 6px; color: var(--muted); font-size: 10px; }
.segmented input:checked + span { color: var(--teal-deep); background: #fff; box-shadow: 0 2px 7px rgba(23,60,69,.1); }
.return-form { display: flex; flex-direction: column; gap: 10px; padding: 14px; background: #fff5f5; border: 1px solid #f1d9da; border-radius: 10px; }
.return-form h3 { margin: 0; color: var(--danger); font-size: 13px; }
.return-form fieldset { display: flex; gap: 13px; padding: 9px; border: 1px solid #efd7d8; border-radius: 8px; }
.return-form legend { color: var(--ink-2); font-size: 9px; }
.check-inline { display: inline-flex; align-items: center; gap: 5px; }
.timeline-panel { padding: 23px; }
.timeline { position: relative; max-width: 690px; margin: 0 auto; }
.timeline::before { content: ""; position: absolute; left: 16px; top: 12px; bottom: 12px; width: 1px; background: var(--line); }
.timeline-item { position: relative; display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 0 0 19px; }
.timeline-glyph { position: relative; z-index: 1; width: 33px; height: 33px; display: grid; place-items: center; color: var(--teal-dark); background: var(--teal-pale); border: 4px solid #fff; border-radius: 50%; font-size: 11px; }
.timeline-card { padding: 11px 13px; background: #fbfdfd; border: 1px solid #e5edef; border-radius: 10px; }
.timeline-card > div { display: flex; justify-content: space-between; gap: 12px; }
.timeline-card strong { font-size: 11px; }
.timeline-card time { color: var(--muted); font-size: 9px; }
.timeline-card p { margin: 5px 0 0; color: var(--ink-2); font-size: 11px; white-space: pre-wrap; }
.timeline-card small { display: block; margin-top: 6px; font-size: 9px; }
.timeline-plan { margin-top: 8px; padding: 8px 9px; background: linear-gradient(110deg, var(--teal-pale), #ebfbf6); border-radius: 7px; }
.timeline-plan strong, .timeline-plan span { display: block; font-size: 9px; }
.timeline-plan span { margin-top: 2px; color: var(--ink-2); }

.toast-stack { position: fixed; right: 18px; bottom: 18px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { max-width: 360px; padding: 12px 15px; color: #fff; background: #173a42; border-radius: 10px; box-shadow: 0 12px 35px rgba(7,33,39,.24); animation: toast-in .2s ease; font-weight: 650; }
.toast.error { background: #a9343a; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.impersonation { min-height: 41px; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 7px 20px; color: #fff; background: #7a5ec0; font-size: 12px; }
.impersonation form { margin: 0; }
.impersonation button { padding: 4px 9px; color: #fff; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.3); border-radius: 6px; cursor: pointer; }
.impersonation + .shell .sidebar { top: 41px; height: calc(100vh - 41px); }

.auth-body { display: grid; min-height: 100vh; place-items: center; padding: 28px; background: #edf6f7; }
.auth-shell { width: min(1050px, 100%); min-height: 620px; display: grid; grid-template-columns: minmax(380px, .92fr) minmax(480px, 1.08fr); overflow: hidden; background: #fff; border-radius: 24px; box-shadow: 0 28px 80px rgba(8,43,50,.15); }
.auth-panel { display: flex; flex-direction: column; justify-content: center; padding: 55px 64px; }
.auth-brand { position: absolute; top: 48px; }
.auth-heading { margin-bottom: 27px; }
.auth-heading h1 { margin: 8px 0 8px; font-size: 29px; }
.auth-heading p { margin: 0; color: var(--muted); }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; }
.auth-form input { min-height: 46px; }
.password-field { position: relative; }
.password-field button { position: absolute; top: 5px; right: 5px; height: 36px; padding: 0 9px; color: var(--teal-dark); background: transparent; border: 0; cursor: pointer; font-size: 10px; font-weight: 700; }
.auth-help { margin: 24px 0 0; color: var(--muted); text-align: center; font-size: 10px; }
.auth-art { position: relative; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; padding: 50px; color: #fff; background: linear-gradient(145deg, #0b7f8f, #00bcd4 60%, #39d3c0); }
.auth-art::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 75% 15%, rgba(255,255,255,.24), transparent 30%), linear-gradient(120deg, transparent 50%, rgba(255,255,255,.08)); }
.auth-art > p { position: relative; z-index: 2; max-width: 390px; margin: 0; font-size: 24px; font-weight: 720; line-height: 1.3; letter-spacing: -.03em; }
.art-orbit { position: absolute; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; }
.art-orbit.one { width: 460px; height: 460px; right: -150px; top: -110px; }
.art-orbit.two { width: 300px; height: 300px; right: -25px; top: 5px; }
.art-card { position: absolute; z-index: 2; width: 235px; padding: 17px; color: var(--ink); background: rgba(255,255,255,.94); border: 1px solid rgba(255,255,255,.65); border-radius: 15px; box-shadow: 0 18px 45px rgba(4,60,68,.22); backdrop-filter: blur(8px); }
.art-card span, .art-card strong, .art-card small { display: block; }
.art-card span { color: var(--teal-dark); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.art-card strong { margin: 5px 0 2px; }
.art-card small { font-size: 9px; }
.card-a { left: 48px; top: 142px; transform: rotate(-3deg); }
.card-b { right: 42px; top: 275px; transform: rotate(3deg); }
.card-b .status-dot { width: 9px; height: 9px; display: inline-block; margin-right: 5px; background: var(--success); border-radius: 50%; }

.row-actions { display: flex; align-items: center; gap: 6px; }
.quick-note-button { min-height: 29px; padding: 4px 8px; color: var(--teal-deep); background: #f4fbfc; border: 1px solid #cfe7ea; border-radius: 7px; cursor: pointer; font-size: 10px; font-weight: 750; }
.quick-note-row td { height: auto; padding: 0 !important; background: linear-gradient(100deg, rgba(0,188,212,.045), rgba(35,212,177,.055)); }
.quick-note-form { display: grid; grid-template-columns: 125px minmax(240px, 1.5fr) minmax(150px,.7fr) minmax(210px,1fr) auto auto; align-items: end; gap: 9px; padding: 13px 16px; white-space: normal; }
.quick-note-form textarea { height: 40px; min-height: 40px; resize: none; }
.verified-check { display: inline-grid; width: 17px; height: 17px; place-items: center; color: #fff; background: linear-gradient(135deg, var(--teal), var(--green)); border-radius: 50%; font-size: 10px; vertical-align: middle; }
.call-state { padding: 4px 7px; border-radius: 6px; font-size: 10px; font-weight: 700; }
.call-state.due { color: #9a6204; background: #fff5dd; }
.call-state.overdue { color: #a5353b; background: #fff0f1; }
.call-state.upcoming { color: #087550; background: #eaf9f3; }
.person-button { padding: 0; text-align: left; border: 0; background: transparent; cursor: pointer; }
.person-button:hover strong, .person-button:hover small { color: var(--teal-dark); }
.data-point { position: relative; }
.edit-pencil { position: absolute; right: 7px; top: 7px; width: 24px; height: 24px; display: grid; place-items: center; color: #86989c; background: transparent; border: 0; border-radius: 6px; cursor: pointer; }
.edit-pencil:hover { color: var(--teal-dark); background: var(--teal-pale); }
.data-point:has(.edit-pencil) strong { padding-right: 20px; }
.forgot-link { align-self: flex-end; margin-top: -9px; font-size: 10px; font-weight: 700; }

.call-momentum { display: grid; grid-template-columns: 170px 1fr; align-items: center; gap: 24px; margin-bottom: 18px; padding: 23px 28px; background: linear-gradient(110deg, #fff, rgba(35,212,177,.045)); border-color: #ccecef; }
.call-momentum h2 { margin: 5px 0; font-size: 19px; }
.call-momentum p { color: var(--muted); font-size: 11px; }
@property --ring-progress { syntax: "<number>"; inherits: false; initial-value: 0; }
.momentum-ring { --ring-progress: 0; width: 146px; height: 146px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(from 0deg, var(--teal) 0 calc(var(--ring-progress) * 1%), #e5eff0 calc(var(--ring-progress) * 1%) 100%); animation: momentum-fill .85s cubic-bezier(.2,.8,.2,1) forwards; }
.momentum-ring::before { content: ""; grid-area: 1/1; width: 112px; height: 112px; background: #fff; border-radius: 50%; box-shadow: 0 5px 18px rgba(10,72,80,.08); }
.momentum-ring > div { grid-area: 1/1; z-index: 1; text-align: center; }
.momentum-ring strong { display: block; font-size: 15px; line-height: 1.05; }
@keyframes momentum-fill { to { --ring-progress: var(--momentum); } }

.report-context { display: flex; align-items: center; gap: 11px; margin: -5px 0 16px; }
.report-context h2 { margin: 1px 0 0; font-size: 17px; }
.report-filter-form { display: block; }
.report-filters { display: grid; grid-template-columns: repeat(3, minmax(150px,1fr)) auto; align-items: end; gap: 10px; padding: 17px 22px; border-bottom: 1px solid #edf2f3; }
.report-date-grid { display: grid; grid-template-columns: repeat(2, minmax(130px,1fr)); gap: 10px; grid-column: 1 / -2; }
.report-section { margin-bottom: 18px; }
.report-section .stat-grid { padding: 18px; margin-bottom: 0; grid-template-columns: repeat(5, minmax(0,1fr)); }
.team-action-cell { min-width: 112px; text-align: center; }
.team-action-cell form { display: flex; justify-content: center; }
.team-action-cell .button { min-width: 102px; }
.muted-dash { color: #aab9bc; }

.message-toolbar { display: flex; gap: 9px; margin-bottom: 14px; }
.message-shell { min-height: 640px; display: grid; grid-template-columns: 330px minmax(0,1fr); }
.thread-list { border-right: 1px solid var(--line); overflow-y: auto; }
.thread-row { display: block; padding: 15px 17px; color: var(--ink-2); border-bottom: 1px solid #edf2f3; }
.thread-row:hover { background: #f8fcfc; }
.thread-row.active { background: var(--teal-pale); box-shadow: inset 3px 0 0 var(--teal); }
.thread-row > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.thread-row i { width: 8px; height: 8px; background: linear-gradient(135deg, var(--teal), var(--green)); border-radius: 50%; }
.thread-row strong { color: var(--ink); font-size: 12px; }
.thread-row.unread strong { color: var(--teal-deep); }
.thread-row small { display: block; margin-top: 3px; font-size: 9px; }
.thread-row p { margin: 6px 0 0; overflow: hidden; color: var(--muted); font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.conversation { min-width: 0; display: flex; flex-direction: column; }
.conversation > header { padding: 19px 22px; border-bottom: 1px solid var(--line); }
.conversation > header h2 { margin: 4px 0 2px; font-size: 18px; }
.conversation > header p { margin: 0; color: var(--muted); font-size: 10px; }
.message-history { flex: 1; padding: 20px 22px; overflow-y: auto; background: #fbfdfd; }
.message-bubble { max-width: 76%; margin-bottom: 12px; padding: 11px 13px; background: #fff; border: 1px solid var(--line); border-radius: 5px 13px 13px 13px; }
.message-bubble.mine { margin-left: auto; background: linear-gradient(135deg, #e9fbfd, #e9fbf5); border-color: #ccebed; border-radius: 13px 5px 13px 13px; }
.message-bubble > div { display: flex; justify-content: space-between; gap: 12px; }
.message-bubble strong { font-size: 10px; }
.message-bubble time { color: var(--muted); font-size: 8px; }
.message-bubble p { margin: 6px 0 0; font-size: 12px; white-space: normal; }
.message-reply { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); }
.message-reply textarea { min-height: 70px; }

@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .routing-grid { grid-template-columns: 1fr; }
  .label-gallery { grid-template-columns: repeat(2, 1fr); }
  .return-item { grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(100px,.6fr)) 80px auto; }
  .return-item > span:nth-of-type(3) { display: none; }
  .quick-note-form { grid-template-columns: 120px minmax(220px,1fr) minmax(150px,.7fr); }
  .quick-note-form .button { align-self: end; }
  .advanced-filters { grid-template-columns: repeat(3, minmax(130px,1fr)); }
  .report-filters { grid-template-columns: repeat(2, minmax(150px,1fr)) auto; }
  .report-section .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .report-date-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 820px) {
  .shell { display: block; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 238px; height: 100vh; transform: translateX(-102%); transition: transform .2s ease; box-shadow: 20px 0 50px rgba(0,0,0,.2); }
  .sidebar.open { transform: translateX(0); }
  .sidebar.open::after { content: ""; position: fixed; inset: 0 0 0 238px; background: rgba(9,32,38,.36); }
  .menu-button { display: inline-flex !important; }
  .topbar { height: 58px; padding: 0 17px; }
  .main { padding: 22px 17px 40px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .routing-summary { grid-template-columns: 1fr 1fr; }
  .routing-summary p { grid-column: 1 / -1; padding: 12px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .lead-overview { grid-template-columns: 1fr; }
  .lead-actions { border-left: 0; border-top: 1px solid var(--line); }
  .auth-shell { grid-template-columns: 1fr; min-height: 590px; }
  .auth-art { display: none; }
  .auth-panel { padding: 80px 45px 45px; }
  .auth-brand { top: 35px; }
  .profile-grid { grid-template-columns: 1fr; }
  .message-shell { grid-template-columns: 270px minmax(0,1fr); }
}

@media (max-width: 620px) {
  body { font-size: 13px; }
  .page-heading { margin-bottom: 17px; flex-direction: column; }
  .page-heading .button { width: 100%; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat-card { min-height: 105px; padding: 14px 12px; gap: 10px; }
  .stat-icon { width: 35px; height: 35px; font-size: 14px; }
  .stat-card strong { font-size: 21px; }
  .stat-card small { display: none; }
  .quick-alerts { grid-template-columns: 1fr; }
  .attention-banner { grid-template-columns: 37px 1fr; }
  .attention-banner .button { grid-column: 1 / -1; }
  .panel-heading { padding: 16px; }
  .filters { align-items: stretch; }
  .filters > label, .filters > label:not(.search-field) { width: 100%; min-width: 0; }
  .filters .button { flex: 1; }
  .filter-primary-row { flex-wrap: wrap; }
  .filter-primary-row .search-field { width: 100%; flex-basis: 100%; }
  .advanced-filters, .report-filters { grid-template-columns: 1fr; }
  .advanced-filters > label, .advanced-filters .filter-field, .advanced-filters .button { width: 100%; }
  .report-date-grid { grid-column: auto; }
  .routing-summary { gap: 10px; padding: 14px; }
  .routing-summary > div strong { font-size: 20px; }
  .routing-card { padding: 15px; }
  .routing-reason { margin-inline: -15px; padding-inline: 15px; }
  .routing-card-top { grid-template-columns: 39px 1fr; }
  .routing-card-top .routing-state { grid-column: 2; }
  .routing-actions { flex-direction: column; }
  .label-gallery { grid-template-columns: 1fr; padding: 12px; }
  .return-list { padding: 4px 10px; }
  .return-item { grid-template-columns: 1fr auto; gap: 7px; padding: 14px 3px; }
  .return-item > span:not(.return-status) { display: none; }
  .return-item .button { grid-column: 1 / -1; }
  .decision-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .modal { width: 100vw; max-height: 94vh; margin: auto 0 0; border-radius: 18px 18px 0 0; }
  .modal::backdrop { background: rgba(7,30,36,.55); }
  .lead-modal { width: 100vw; height: 94vh; }
  .modal-header, .modal-body { padding-inline: 17px; }
  .modal-footer { padding-inline: 17px; }
  .lead-data { padding-inline: 17px; }
  .data-grid { grid-template-columns: 1fr; }
  .danger-zone { flex-direction: column; }
  .notification-panel { padding-inline: 11px; }
  .notification-item { grid-template-columns: 36px 1fr; }
  .notification-item > form { grid-column: 2; }
  .auth-body { padding: 0; background: #fff; }
  .auth-shell { min-height: 100vh; border-radius: 0; box-shadow: none; }
  .auth-panel { padding: 82px 25px 35px; justify-content: flex-start; }
  .auth-brand { top: 28px; }
  .auth-heading { margin-top: 44px; }
  .impersonation { justify-content: space-between; }
  .call-momentum { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .quick-note-form { grid-template-columns: 1fr; }
  .report-section .stat-grid, .report-date-grid { grid-template-columns: 1fr; }
  .message-shell { display: block; }
  .thread-list { max-height: 300px; border-right: 0; border-bottom: 1px solid var(--line); }
  .message-bubble { max-width: 92%; }
  .message-reply { grid-template-columns: 1fr; }
  .message-toolbar { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
