/*
Theme Name:        Gendox Demo CRM
Description:       Demo CRM app for Gendox: dashboard, contact search, contact records with notes, pipeline, knowledge base. Requires the Gendox CRM Demo Data plugin.
Version:           1.0.0
Requires at least: 6.4
Requires PHP:      8.0
Author:            Gendox
License:           GPL-2.0-or-later
Text Domain:       gendox-crm
*/

:root {
	--crm-ink: #121315;
	--crm-ink-2: #3b3e44;
	--crm-muted: #6c727c;
	--crm-faint: #9aa0a8;
	--crm-line: rgba(18, 19, 21, .08);
	--crm-glass: rgba(255, 255, 255, .46);
	--crm-glass-2: rgba(255, 255, 255, .62);
	--crm-glass-line: rgba(255, 255, 255, .75);
	--crm-blue: #2948F4;
	--crm-yellow: #F1E04C;
	--crm-teal: #4A8797;
	--crm-sand: #E5D3A2;
	--crm-black: #111214;
	--crm-green: #2F8F5B;
	--crm-red: #C2453F;
	--crm-radius: 28px;
	--crm-radius-sm: 20px;
	--crm-font: 'Urbanist', system-ui, sans-serif;
	--crm-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 18px 40px -24px rgba(33, 52, 74, .35);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	font-family: var(--crm-font);
	color: var(--crm-ink);
	font-size: 15px;
	background:
		radial-gradient(1200px 700px at 8% -10%, #d7e3ee 0%, transparent 60%),
		radial-gradient(1000px 800px at 105% 20%, #eef3dc 0%, transparent 55%),
		linear-gradient(135deg, #dfe7ee 0%, #e8edef 45%, #eef1e6 100%);
	background-attachment: fixed;
	min-height: 100vh;
	-webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { flex-shrink: 0; }

/* --- demo bar ---------------------------------------------------------------------------- */
.crm-demo-bar {
	display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 14px;
	padding: 8px 16px; background: var(--crm-black); color: #d8dbe0; font-size: 12.5px;
}
.crm-demo-bar strong { background: var(--crm-yellow); color: var(--crm-black); border-radius: 999px; padding: 2px 9px; font-size: 11px; letter-spacing: .08em; }
.crm-demo-bar a { color: #fff; font-weight: 600; }
.crm-demo-bar__reset {
	display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 1px solid rgba(255, 255, 255, .25);
	color: #fff; border-radius: 999px; padding: 3px 10px; cursor: pointer; font-size: 12px;
}
.crm-demo-bar__reset svg { width: 14px; height: 14px; }

/* --- shell -------------------------------------------------------------------------------- */
.crm-shell { max-width: 1440px; margin: 0 auto; padding: 18px 36px 60px 112px; }
.crm-top { display: flex; align-items: center; gap: 24px; padding: 6px 0 18px; }
.crm-logo { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.crm-logo__mark { color: var(--crm-black); display: inline-flex; }
.crm-logo__text { font-size: 21px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.crm-logo__text em { font-style: italic; font-weight: 600; color: var(--crm-muted); margin-left: 1px; }
.crm-nav { display: flex; gap: 4px; margin: 0 auto; flex-wrap: wrap; justify-content: center; }
.crm-nav a { text-decoration: none; font-size: 13.5px; font-weight: 500; padding: 10px 18px; border-radius: 999px; color: var(--crm-ink-2); }
.crm-nav a:hover { background: var(--crm-glass); }
.crm-nav a.is-active { background: var(--crm-black); color: #fff; }
.crm-top__tools { display: flex; gap: 10px; align-items: center; }

.crm-iconbtn {
	position: relative; display: inline-flex; align-items: center; justify-content: center;
	width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
	background: var(--crm-glass); border: 1px solid var(--crm-glass-line); color: var(--crm-ink);
	text-decoration: none; cursor: pointer; transition: background .2s, transform .2s;
}
.crm-iconbtn:hover { background: #fff; }
.crm-iconbtn--soft { background: rgba(255, 255, 255, .35); }
.crm-iconbtn--card { width: 36px; height: 36px; background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .45); color: inherit; }
.crm-dot { position: absolute; top: 9px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: #e2483d; }

.crm-avatar {
	--h: 210;
	display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
	width: 34px; height: 34px; border-radius: 50%;
	background: linear-gradient(135deg, hsl(var(--h) 70% 82%), hsl(calc(var(--h) + 30) 60% 70%));
	color: hsl(var(--h) 45% 22%); font-weight: 700; font-size: 12px; letter-spacing: .02em;
	border: 2px solid rgba(255, 255, 255, .9);
}
.crm-avatar--xs { width: 22px; height: 22px; font-size: 9px; border-width: 1px; }
.crm-avatar--lg { width: 52px; height: 52px; font-size: 16px; }
.crm-avatar--xl { width: 116px; height: 116px; font-size: 34px; border-width: 4px; margin: 0 auto 14px; box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .35); }
.crm-avatar--me { --h: 330; width: 42px; height: 42px; }
.crm-stack { display: inline-flex; }
.crm-stack .crm-avatar { margin-left: -9px; width: 30px; height: 30px; font-size: 10.5px; }
.crm-stack .crm-avatar:first-child { margin-left: 0; }

/* floating icon rail */
.crm-rail {
	position: fixed; left: 26px; top: 50%; transform: translateY(-40%); z-index: 20;
	display: flex; flex-direction: column; gap: 10px; padding: 12px 9px; border-radius: 999px;
	background: #1d1e20; box-shadow: 0 20px 40px -16px rgba(0, 0, 0, .5);
}
.crm-rail a {
	display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%;
	background: #2a2b2e; color: #d9dadd; text-decoration: none;
}
.crm-rail a:hover { background: var(--crm-yellow); color: var(--crm-black); }

/* --- page head + KPIs ------------------------------------------------------------------------ */
.crm-head { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin: 10px 0 24px; }
.crm-title { font-size: 34px; line-height: 1.05; font-weight: 600; letter-spacing: -.015em; margin: 0; }
.crm-title--article { font-size: 36px; }
.crm-eyebrow { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--crm-muted); }
.crm-head__intro { max-width: 520px; color: var(--crm-muted); font-size: 14px; line-height: 1.55; }
.crm-head__intro p { margin: 0; }
.crm-kpis { display: flex; gap: 34px; margin-left: auto; flex-wrap: wrap; }
.crm-kpi { display: flex; align-items: center; gap: 12px; }
.crm-kpi b { display: block; font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.crm-kpi > div > span { display: block; font-size: 12px; color: var(--crm-muted); line-height: 1.25; }
.crm-kpi > .crm-chip { align-self: flex-start; }

.crm-chip {
	display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 4px 10px;
	font-size: 11.5px; font-weight: 600; font-style: normal; line-height: 1.2; white-space: nowrap;
	background: rgba(255, 255, 255, .7); color: var(--crm-ink-2);
}
.crm-chip--yellow { background: var(--crm-yellow); color: var(--crm-black); }
.crm-chip--blue { background: var(--crm-blue); color: #fff; }
.crm-chip--soft { background: rgba(255, 255, 255, .55); color: var(--crm-muted); font-weight: 500; }
.crm-chip--outline { background: transparent; border: 1px solid var(--crm-line); color: var(--crm-muted); font-weight: 500; }
.crm-chip--lead { background: #e4e8ff; color: #2238b8; }
.crm-chip--qualified { background: #fbf3b8; color: #6b5d00; }
.crm-chip--customer { background: #d5ece2; color: #1f6b47; }
.crm-chip--churned { background: #efdcdc; color: #8a3330; }
.crm-chip--qualification { background: #fff; }
.crm-chip--toggle { border: 1px solid var(--crm-line); background: rgba(255, 255, 255, .4); cursor: pointer; color: var(--crm-muted); font-weight: 500; }
.crm-chip--toggle.is-on { background: var(--crm-black); color: #fff; border-color: var(--crm-black); }

/* --- panels -------------------------------------------------------------------------------- */
.crm-panel {
	background: var(--crm-glass); border: 1px solid var(--crm-glass-line); border-radius: var(--crm-radius);
	padding: 22px; box-shadow: var(--crm-shadow);
	backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
	min-width: 0;
}
.crm-panel__head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.crm-panel__head h2 { margin: 0; font-size: 16px; font-weight: 600; }
.crm-panel__head--end { justify-content: flex-end; }
.crm-panel__tools { margin-left: auto; display: flex; gap: 8px; }
.crm-panel__tools .crm-iconbtn { width: 38px; height: 38px; background: transparent; border-color: rgba(18, 19, 21, .12); }
.crm-panel__hint { margin-left: auto; font-size: 12.5px; color: var(--crm-muted); }
.crm-muted { color: var(--crm-muted); font-size: 14px; }

/* --- dashboard grid -------------------------------------------------------------------------- */
.crm-dashboard {
	display: grid; gap: 18px;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) minmax(280px, .72fr);
	grid-template-areas:
		"history history profile"
		"tasks funnel details";
}
.crm-panel--history { grid-area: history; }
.crm-panel--profile { grid-area: profile; }
.crm-panel--tasks { grid-area: tasks; }
.crm-panel--funnel { grid-area: funnel; }
.crm-dashboard .crm-panel--details { grid-area: details; }

.crm-deal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.crm-deal {
	position: relative; display: flex; flex-direction: column; min-height: 150px; padding: 16px 16px 14px;
	border-radius: var(--crm-radius-sm); background: rgba(255, 255, 255, .55); border: 1px solid rgba(255, 255, 255, .8);
	color: var(--crm-ink);
}
.crm-deal--blue { background: var(--crm-blue); color: #fff; border-color: transparent; }
.crm-deal--yellow { background: var(--crm-yellow); color: var(--crm-black); border-color: transparent; }
.crm-deal--teal { background: var(--crm-teal); color: #fff; border-color: transparent; }
.crm-deal--black { background: var(--crm-black); color: #fff; border-color: transparent; }
.crm-deal--yellow .crm-iconbtn--card { background: rgba(0, 0, 0, .06); border-color: rgba(0, 0, 0, .18); }
.crm-deal--black .crm-iconbtn--card { background: #fff; color: var(--crm-black); }
.crm-deal__top { display: flex; justify-content: space-between; align-items: flex-start; }
.crm-deal__date { font-size: 12px; opacity: .75; }
.crm-deal__title { margin: 2px 0 4px; font-size: 15px; font-weight: 600; line-height: 1.25; max-width: 80%; }
.crm-deal__company { margin: 0; font-size: 12px; opacity: .72; }
.crm-deal__bottom { margin-top: auto; padding-top: 14px; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.crm-deal__value { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.crm-deal--glass .crm-deal__value { font-weight: 500; color: var(--crm-ink-2); }
.crm-deal__new { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; background: var(--crm-yellow); color: var(--crm-black); border-radius: 999px; padding: 2px 8px; }
.crm-deal--compact { min-height: 0; padding: 14px; }
.crm-deal--compact .crm-deal__title { font-size: 14px; }
.crm-deal--compact .crm-deal__value { font-size: 17px; }
.crm-deal--compact .crm-iconbtn--card { width: 30px; height: 30px; }
.crm-deal--compact .crm-iconbtn--card svg { width: 15px; height: 15px; }

.crm-profile { text-align: center; }
.crm-profile .crm-panel__head { margin-bottom: 6px; }
.crm-profile__name { margin: 0 0 4px; font-size: 22px; font-weight: 600; }
.crm-profile__role { margin: 0 auto 12px; max-width: 220px; color: var(--crm-muted); font-size: 13.5px; line-height: 1.4; }
.crm-profile__tags { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; }
.crm-profile__actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.crm-profile__actions .crm-iconbtn { width: 38px; height: 38px; background: rgba(255, 255, 255, .55); }

.crm-detail { display: flex; gap: 12px; align-items: flex-start; padding: 9px 0; color: var(--crm-muted); }
.crm-detail > svg { margin-top: 3px; }
.crm-detail span { display: block; font-size: 11.5px; color: var(--crm-faint); }
.crm-detail b { display: block; font-size: 15px; font-weight: 500; color: var(--crm-ink); word-break: break-word; }

/* calendar */
.crm-cal__nav { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.crm-cal__nav b { margin-left: 10px; font-size: 18px; font-weight: 500; }
.crm-cal__nav .crm-iconbtn { width: 36px; height: 36px; }
.crm-cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.crm-cal__dow { text-align: center; font-size: 11px; color: var(--crm-faint); }
.crm-cal__cell {
	position: relative; aspect-ratio: 1 / 1.1; border-radius: 12px; background: rgba(255, 255, 255, .32);
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--crm-faint);
}
.crm-cal__cell.is-empty { background: transparent; }
.crm-cal__cell i { font-style: normal; }
.crm-cal__cell a { text-decoration: none; }
.crm-cal__cell .crm-stack .crm-avatar { width: 22px; height: 22px; font-size: 8px; margin-left: -6px; }
.crm-cal__cell .crm-stack .crm-avatar:first-child { margin-left: 0; }
.crm-cal__cell--blue { background: var(--crm-blue); color: #fff; }
.crm-cal__cell--yellow { background: var(--crm-yellow); color: var(--crm-black); }
.crm-cal__cell--teal { background: var(--crm-teal); color: #fff; }
.crm-cal__cell--sand { background: var(--crm-sand); color: var(--crm-black); }
.crm-cal__cell.is-today { outline: 2px solid var(--crm-black); outline-offset: -2px; }

/* funnel */
.crm-funnel__summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.crm-funnel__summary b { display: block; font-size: 22px; font-weight: 600; }
.crm-funnel__summary span { font-size: 12px; color: var(--crm-muted); }
.crm-toggle { display: inline-flex; background: rgba(255, 255, 255, .45); border-radius: 999px; padding: 3px; }
.crm-toggle button { border: 0; background: transparent; border-radius: 999px; padding: 6px 12px; font-size: 12px; cursor: pointer; color: var(--crm-muted); }
.crm-toggle button.is-active { background: rgba(18, 19, 21, .1); color: var(--crm-ink); font-weight: 600; }
.crm-funnel { display: flex; flex-direction: column; gap: 8px; }
.crm-funnel__step {
	display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
	margin-left: calc(var(--i) * 22px); padding: 12px 14px; border-radius: 18px; background: rgba(255, 255, 255, .45);
	border: 1px solid rgba(255, 255, 255, .7); text-decoration: none;
}
.crm-funnel__step span { font-size: 12px; color: var(--crm-muted); grid-column: 1; }
.crm-funnel__step b { font-size: 18px; font-weight: 500; color: var(--crm-ink-2); grid-column: 1; }
.crm-funnel__step svg { grid-row: 1 / 3; grid-column: 2; color: var(--crm-muted); }
.crm-funnel[data-mode="total"] .crm-funnel__weighted,
.crm-funnel[data-mode="weighted"] .crm-funnel__total { display: none; }
.crm-funnel__w { margin: 4px 0 0; font-size: 12px; color: var(--crm-muted); }

/* --- filter bar --------------------------------------------------------------------------------- */
.crm-filterbar { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding: 16px 18px; margin-bottom: 14px; }
.crm-search {
	flex: 1 1 240px; display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 16px;
	border-radius: 999px; background: rgba(255, 255, 255, .7); border: 1px solid var(--crm-glass-line); color: var(--crm-muted);
}
.crm-search input { flex: 1; border: 0; background: transparent; outline: none; font-size: 14.5px; color: var(--crm-ink); min-width: 0; }
.crm-filter { display: flex; flex-direction: column; gap: 4px; border-radius: 16px; transition: box-shadow .3s; }
.crm-filter > span, .crm-field > span { font-size: 11.5px; font-weight: 600; color: var(--crm-muted); padding-left: 4px; }
.crm-filter select, .crm-field select {
	appearance: none; -webkit-appearance: none; height: 46px; padding: 0 34px 0 14px; border-radius: 999px;
	border: 1px solid var(--crm-glass-line); background: rgba(255, 255, 255, .7) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%236c727c' stroke-width='1.8'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E") no-repeat right 14px center;
	font-size: 13.5px; cursor: pointer; min-width: 120px;
}
.crm-btn {
	display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 999px;
	border: 0; background: var(--crm-black); color: #fff; font-weight: 600; font-size: 13.5px; cursor: pointer; text-decoration: none;
}
.crm-btn:hover { background: #2a2c30; }
.crm-btn--ghost { background: rgba(255, 255, 255, .55); color: var(--crm-ink); border: 1px solid var(--crm-glass-line); }
.crm-btn--ghost:hover { background: #fff; }
.crm-count { margin: 4px 6px 14px; color: var(--crm-muted); font-size: 13.5px; }
.crm-count b { color: var(--crm-ink); }
.is-agent-set { animation: crm-agent 2.4s ease; }
@keyframes crm-agent {
	0%, 60% { box-shadow: 0 0 0 3px var(--crm-yellow), 0 0 0 7px rgba(241, 224, 76, .35); }
	100% { box-shadow: 0 0 0 0 rgba(241, 224, 76, 0); }
}

/* contact cards */
.crm-contact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.crm-ccard {
	display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: var(--crm-radius-sm);
	background: var(--crm-glass-2); border: 1px solid var(--crm-glass-line); text-decoration: none; box-shadow: var(--crm-shadow);
	transition: transform .2s, background .2s;
}
.crm-ccard:hover { transform: translateY(-2px); background: rgba(255, 255, 255, .85); }
.crm-ccard__top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.crm-ccard .crm-iconbtn--card { color: var(--crm-ink); border-color: rgba(18, 19, 21, .12); }
.crm-ccard h3 { margin: 0; font-size: 18px; font-weight: 600; }
.crm-ccard__role { margin: 0; color: var(--crm-muted); font-size: 13px; }
.crm-ccard__chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.crm-ccard__next { margin: 0; font-size: 13px; line-height: 1.45; color: var(--crm-ink-2); }
.crm-ccard__next span { color: var(--crm-faint); }
.crm-ccard__meta { margin: 6px 0 0; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--crm-muted); }
.crm-empty { grid-column: 1 / -1; padding: 40px; text-align: center; border-radius: var(--crm-radius); background: var(--crm-glass); }
.crm-empty b { display: block; font-size: 17px; margin-bottom: 4px; }
.crm-empty span { color: var(--crm-muted); }

/* --- contact record ------------------------------------------------------------------------------ */
.crm-record { display: grid; grid-template-columns: minmax(270px, .8fr) minmax(0, 1.5fr) minmax(260px, .85fr); gap: 18px; align-items: start; }
.crm-record__side, .crm-record__main, .crm-record__aside { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.crm-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.crm-form--details { grid-template-columns: 1fr; gap: 10px; }
.crm-form--notes { grid-template-columns: 1fr 1fr; }
.crm-form--inline { grid-template-columns: 160px 170px 1fr; margin-bottom: 18px; }
.crm-form--deal { grid-template-columns: repeat(3, 1fr); }
.crm-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; border-radius: 16px; }
.crm-field--wide { grid-column: 1 / -1; }
.crm-field input, .crm-field textarea {
	width: 100%; border: 1px solid var(--crm-glass-line); background: rgba(255, 255, 255, .7); border-radius: 16px;
	padding: 12px 14px; font-size: 14px; outline: none; transition: border-color .2s;
}
.crm-field input { height: 46px; border-radius: 999px; }
.crm-field textarea { resize: vertical; min-height: 78px; line-height: 1.45; }
.crm-field select { width: 100%; }
.crm-field :is(input, select, textarea):focus { border-color: var(--crm-ink-2); }
.crm-field .is-invalid { border-color: var(--crm-red) !important; }
.crm-form.is-agent-filled { animation: crm-agent 2.4s ease; border-radius: 18px; }
.crm-form__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 0; }
.crm-form__status { font-size: 13px; color: var(--crm-muted); }
.crm-form__status.is-error { color: var(--crm-red); }
.crm-form__status.is-success { color: var(--crm-green); font-weight: 600; }
.crm-tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px; border-radius: 16px; }

.crm-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.crm-timeline li { display: flex; gap: 12px; }
.crm-timeline__icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, .7); flex-shrink: 0; }
.crm-timeline__icon--call { background: var(--crm-yellow); }
.crm-timeline__icon--meeting { background: var(--crm-blue); color: #fff; }
.crm-timeline__icon--email { background: var(--crm-teal); color: #fff; }
.crm-timeline b { font-size: 14px; }
.crm-timeline time { font-size: 12.5px; color: var(--crm-muted); }
.crm-timeline p { margin: 3px 0 0; font-size: 14px; line-height: 1.45; color: var(--crm-ink-2); }

.crm-deal-stack { display: flex; flex-direction: column; gap: 10px; }
.crm-tasklist { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.crm-tasklist li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 16px; background: rgba(255, 255, 255, .5); }
.crm-tasklist li b { display: block; font-size: 14px; font-weight: 600; }
.crm-tasklist li span { font-size: 12px; color: var(--crm-muted); }
.crm-tasklist li.is-overdue span { color: var(--crm-red); }

/* --- deals board --------------------------------------------------------------------------------- */
.crm-drawer { margin-bottom: 14px; }
.crm-drawer[hidden] { display: none; }
.crm-board { display: grid; grid-template-columns: repeat(5, minmax(210px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.crm-board__col { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: var(--crm-radius); background: rgba(255, 255, 255, .28); border: 1px solid rgba(255, 255, 255, .55); min-height: 160px; }
.crm-board__col header { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 6px 6px; }
.crm-board__col header b { font-size: 14px; }
.crm-board__col header span { font-size: 12px; color: var(--crm-muted); }

/* --- knowledge base ------------------------------------------------------------------------------- */
.crm-ask { display: flex; gap: 12px; align-items: center; margin: 0 0 12px; padding: 14px 18px; border-radius: var(--crm-radius-sm); background: var(--crm-black); color: #e3e5e8; }
.crm-ask > span { display: inline-flex; width: 38px; height: 38px; border-radius: 50%; align-items: center; justify-content: center; background: var(--crm-yellow); color: var(--crm-black); flex-shrink: 0; }
.crm-ask p { margin: 0; font-size: 14px; line-height: 1.45; }
.crm-ask b { color: #fff; }
.crm-kb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.crm-kb {
	position: relative; display: flex; flex-direction: column; gap: 8px; min-height: 190px; padding: 20px; border-radius: var(--crm-radius-sm);
	text-decoration: none; background: var(--crm-glass-2); border: 1px solid var(--crm-glass-line); box-shadow: var(--crm-shadow);
}
.crm-kb--blue { background: var(--crm-blue); color: #fff; border-color: transparent; }
.crm-kb--yellow { background: var(--crm-yellow); border-color: transparent; }
.crm-kb--teal { background: var(--crm-teal); color: #fff; border-color: transparent; }
.crm-kb__topic { font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.crm-kb h3 { margin: 0; font-size: 19px; font-weight: 600; line-height: 1.2; padding-right: 40px; }
.crm-kb p { margin: 0; font-size: 13.5px; line-height: 1.45; opacity: .8; }
.crm-kb .crm-iconbtn--card { position: absolute; top: 16px; right: 16px; }
.crm-kb--glass .crm-iconbtn--card { color: var(--crm-ink); border-color: rgba(18, 19, 21, .12); }

/* --- articles + how-it-works ----------------------------------------------------------------------- */
.crm-article { max-width: 860px; padding: 34px 40px; font-size: 15.5px; line-height: 1.65; color: var(--crm-ink-2); }
.crm-article--wide { max-width: 1000px; margin: 0 auto; }
.crm-article h1 { font-size: 38px; line-height: 1.1; font-weight: 600; letter-spacing: -.015em; color: var(--crm-ink); margin: 0 0 16px; }
.crm-article h2 { font-size: 22px; font-weight: 600; color: var(--crm-ink); margin: 34px 0 12px; }
.crm-article strong, .crm-article dt { color: var(--crm-ink); }
.crm-article a { color: var(--crm-blue); }
.crm-article table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; background: rgba(255, 255, 255, .5); border-radius: 16px; overflow: hidden; }
.crm-article th, .crm-article td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--crm-line); vertical-align: top; }
.crm-article th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--crm-muted); }
.crm-article li { margin-bottom: 6px; }
.crm-article__meta { margin-top: 28px; font-size: 12.5px; color: var(--crm-faint); }
.crm-article code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86em; background: rgba(18, 19, 21, .06); padding: 1px 5px; border-radius: 5px; color: var(--crm-ink); }
.crm-article .gdx-lead { font-size: 17px; }
.crm-article .gdx-eyebrow { margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--crm-muted); }
.gdx-how-demos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 8px 0 24px; }
.crm-article .gdx-how-demos a { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: 20px; background: rgba(255, 255, 255, .65); text-decoration: none; color: var(--crm-ink); border: 1px solid var(--crm-glass-line); }
.gdx-how-demos a:nth-child(2) { background: var(--crm-blue) !important; color: #fff !important; }
.gdx-how-demos strong { font-size: 18px; color: inherit; }
.gdx-how-demos span { font-size: 12.5px; opacity: .75; }
.gdx-how-steps { counter-reset: how; list-style: none; padding: 0; }
.gdx-how-steps li { counter-increment: how; position: relative; padding-left: 42px; margin-bottom: 14px; }
.gdx-how-steps li::before { content: counter(how); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--crm-black); color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.gdx-how-terms { margin: 0 0 24px; padding: 18px 22px; border-radius: 20px; background: rgba(255, 255, 255, .55); }
.gdx-how-terms dt { font-weight: 600; margin-top: 12px; }
.gdx-how-terms dt:first-child { margin-top: 0; }
.gdx-how-terms dd { margin: 3px 0 0; font-size: 14.5px; }
.crm-article pre.gdx-code { margin: 0 0 18px; padding: 18px 20px; overflow-x: auto; border-radius: 18px; background: var(--crm-black); color: #e7e9ec; font-size: 12.5px; line-height: 1.6; white-space: pre; }
.crm-article pre.gdx-code code { background: none; color: inherit; padding: 0; font-size: inherit; }
.crm-article pre.gdx-code--prompt { white-space: pre-wrap; background: #fffbe0; color: var(--crm-ink); border: 1px dashed #d8c84a; }
.gdx-how-file { margin: 0 0 12px; border-radius: 18px; background: rgba(255, 255, 255, .6); border: 1px solid var(--crm-glass-line); }
.gdx-how-file > summary { cursor: pointer; padding: 12px 16px; font-size: 14px; }
.crm-article .gdx-how-file pre.gdx-code { margin: 0; border-radius: 0 0 18px 18px; }

/* --- toast --------------------------------------------------------------------------------------- */
.crm-toast {
	position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 50;
	background: var(--crm-black); color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 14px; font-weight: 500;
	transition: opacity .25s, transform .25s; box-shadow: 0 16px 30px -12px rgba(0, 0, 0, .5);
}
.crm-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* --- responsive ------------------------------------------------------------------------------------ */
@media (max-width: 1200px) {
	.crm-dashboard { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "history history" "profile details" "tasks funnel"; }
	.crm-record { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
	.crm-record__aside { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
	.crm-kpis { margin-left: 0; width: 100%; }
}
@media (max-width: 860px) {
	.crm-shell { padding: 12px 16px 96px; }
	.crm-rail { top: auto; bottom: 14px; left: 50%; transform: translateX(-50%); flex-direction: row; padding: 8px; }
	.crm-rail a { width: 38px; height: 38px; }
	.crm-top { flex-wrap: wrap; gap: 12px; }
	.crm-nav { order: 3; width: 100%; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; }
	.crm-nav a { white-space: nowrap; padding: 9px 14px; }
	.crm-top__tools { margin-left: auto; }
	.crm-title { font-size: 28px; }
	.crm-kpis { gap: 18px; }
	.crm-dashboard, .crm-record, .crm-record__aside { grid-template-columns: minmax(0, 1fr); grid-template-areas: none; display: flex; flex-direction: column; }
	.crm-deal-grid { grid-template-columns: 1fr 1fr; }
	.crm-form, .crm-form--notes, .crm-form--inline, .crm-form--deal { grid-template-columns: minmax(0, 1fr); }
	.crm-filter { flex: 1 1 140px; }
	.crm-filter select { width: 100%; min-width: 0; }
	.crm-article { padding: 22px 18px; }
	.gdx-how-demos { grid-template-columns: minmax(0, 1fr); }
	.crm-board { grid-template-columns: repeat(5, minmax(230px, 80vw)); }
}
@media (max-width: 480px) {
	.crm-deal-grid { grid-template-columns: minmax(0, 1fr); }
	.crm-top__tools .crm-iconbtn { display: none; }
}
