/* ============================================================
   UP CRM — Base Styles
   ============================================================ */

/*
 * Z-INDEX MAP — do not use values outside these slots
 *   10  → sticky table/page headers
 *   50  → inline dropdowns (filter, search autocomplete)
 *  100  → sidebar
 *  200  → QV backdrop (pointer-events:none)
 *  210  → QV panel
 *  250  → invoice/side-panel detail
 *  300  → tooltips / popovers
 *  400  → modal overlay
 *  500  → notifications panel
 *  600  → toasts (showToast, undo-toast) — above modals
 *  700  → critical overlays
 */

/* ── Reset & Base ── */
*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

:root {
	--color-primary: #1a56db;
	--color-primary-h: #1648c0;
	--color-primary-light: #eff6ff;
	--color-sidebar-bg: #1e293b;
	--color-sidebar-h: #273548;
	--color-sidebar-txt: #94a3b8;
	--color-sidebar-act: #e2e8f0;
	--color-bg: #f8fafc;
	--color-surface: #ffffff;
	--color-border: #e2e8f0;
	--color-text: #374151;
	--color-text-secondary: #475569;
	--color-muted: #94a3b8;
	--color-danger: #ef4444;
	--color-success: #10b981;
	--color-warning: #f59e0b;
	--color-border-strong: #cbd5e1;
	--radius: 8px;
	--sidebar-w: 220px;
	--shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
	--shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
	--shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.15);
	--sb-size: 5px;
	--sb-thumb: #cbd5e1;
	--sb-thumb-hover: #94a3b8;
}

/* ── Global focus accessibility ── */
:focus-visible {
	outline: 2px solid var(--color-primary);
	outline-offset: 2px;
	border-radius: 4px;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: 14px;
	color: var(--color-text);
	background: var(--color-bg);
}
a {
	color: inherit;
	text-decoration: none;
}
button {
	cursor: pointer;
	font: inherit;
}
input,
select,
textarea {
	font: inherit;
}
.hidden {
	display: none !important;
}

/* ── LOGIN PAGE ── */
.login-body {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.login-card {
	background: var(--color-surface);
	border-radius: 16px;
	padding: 48px 40px;
	width: 380px;
	text-align: center;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-logo {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin-bottom: 32px;
}
.login-logo-mark {
	width: 48px;
	height: 48px;
	border-radius: 12px;
	background: #c8102e;
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
}
.login-logo-text {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}
.login-logo-title {
	font-size: 16px;
	font-weight: 700;
	color: var(--color-text);
}
.login-logo-sub {
	font-size: 11px;
	font-weight: 500;
	color: var(--color-muted);
	letter-spacing: 1px;
	text-transform: uppercase;
}

.login-heading {
	font-size: 22px;
	font-weight: 700;
	margin-bottom: 6px;
}
.login-sub {
	color: var(--color-muted);
	margin-bottom: 28px;
	font-size: 14px;
}

.btn-google {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	padding: 12px 20px;
	border-radius: var(--radius);
	border: 1.5px solid var(--color-border);
	background: white;
	font-size: 14px;
	font-weight: 500;
	color: var(--color-text);
	transition:
		background 0.15s,
		border-color 0.15s,
		box-shadow 0.15s;
}
.btn-google:hover {
	background: #f8fafc;
	border-color: #94a3b8;
	box-shadow: var(--shadow-sm);
}
.btn-google:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.login-input {
	width: 100%;
	padding: 10px 14px;
	border-radius: var(--radius);
	border: 1.5px solid var(--color-border);
	font-size: 14px;
	outline: none;
	transition: border-color 0.15s;
	margin-bottom: 12px;
}
.login-input:focus {
	border-color: var(--color-primary);
}

.btn-magic {
	width: 100%;
	padding: 12px 20px;
	border-radius: var(--radius);
	background: var(--color-primary);
	color: white;
	border: none;
	font-size: 14px;
	font-weight: 600;
	transition: background 0.15s;
}
.btn-magic:hover {
	background: var(--color-primary-h);
}
.btn-magic:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.magic-sent-icon {
	font-size: 40px;
	margin-bottom: 12px;
}
.magic-sent-text {
	font-size: 14px;
	color: var(--color-muted);
	line-height: 1.5;
}
.login-note {
	font-size: 12px;
	color: var(--color-muted);
	margin-top: 16px;
}
.login-error {
	margin-top: 16px;
	padding: 10px 14px;
	border-radius: var(--radius);
	background: #fef2f2;
	color: var(--color-danger);
	font-size: 13px;
	border: 1px solid #fecaca;
}

/* ── APP LAYOUT ── */
.app-body {
	display: flex;
	height: 100vh;
	overflow: hidden;
}

/* ── SIDEBAR ── */
.sidebar {
	width: var(--sidebar-w);
	background: var(--color-sidebar-bg);
	display: flex;
	flex-direction: column;
	position: fixed;
	top: 0;
	left: 0;
	height: 100vh;
	z-index: 100;
	flex-shrink: 0;
	transition: width 0.2s ease;
	overflow: hidden;
}

.sidebar-header {
	padding: 14px 12px;
	border-bottom: 1px solid #ffffff10;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	min-height: 54px;
	flex-shrink: 0;
}
.sidebar-logo {
	display: flex;
	align-items: center;
	gap: 10px;
	overflow: hidden;
	flex: 1;
	min-width: 0;
}
.sidebar-logo-mark {
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.sidebar-logo-text {
	font-size: 14px;
	font-weight: 600;
	color: var(--color-sidebar-act);
	letter-spacing: 0;
	white-space: nowrap;
	transition: opacity 0.15s;
}

.sidebar-toggle { display: none; }

/* ── LOADING SIDEBAR (hide nav until permissions applied) ── */
.sidebar--loading .nav-item {
	visibility: hidden;
}

/* ── SCROLLBAR SUTIL (A2) ── */
.table-wrap,
.qv-body,
.pp-left,
.pp-card-area,
.pp-tab-content,
.pp-person-sidebar,
.kanban-board,
.kanban-col-body,
.inv-table-wrap,
.inv-detail-body,
.cpd-main,
.cpd-sidebar,
.notif-list {
	scrollbar-width: thin;
	scrollbar-color: var(--sb-thumb) transparent;
}
.table-wrap::-webkit-scrollbar,
.qv-body::-webkit-scrollbar,
.pp-left::-webkit-scrollbar,
.pp-card-area::-webkit-scrollbar,
.pp-tab-content::-webkit-scrollbar,
.pp-person-sidebar::-webkit-scrollbar,
.kanban-board::-webkit-scrollbar,
.kanban-col-body::-webkit-scrollbar,
.inv-table-wrap::-webkit-scrollbar,
.inv-detail-body::-webkit-scrollbar,
.cpd-main::-webkit-scrollbar,
.cpd-sidebar::-webkit-scrollbar,
.notif-list::-webkit-scrollbar {
	width: var(--sb-size);
	height: var(--sb-size);
}
.table-wrap::-webkit-scrollbar-track,
.qv-body::-webkit-scrollbar-track,
.pp-left::-webkit-scrollbar-track,
.pp-card-area::-webkit-scrollbar-track,
.pp-tab-content::-webkit-scrollbar-track,
.pp-person-sidebar::-webkit-scrollbar-track,
.kanban-board::-webkit-scrollbar-track,
.kanban-col-body::-webkit-scrollbar-track,
.inv-table-wrap::-webkit-scrollbar-track,
.inv-detail-body::-webkit-scrollbar-track,
.cpd-main::-webkit-scrollbar-track,
.cpd-sidebar::-webkit-scrollbar-track,
.notif-list::-webkit-scrollbar-track {
	background: transparent;
}
.table-wrap::-webkit-scrollbar-thumb,
.qv-body::-webkit-scrollbar-thumb,
.pp-left::-webkit-scrollbar-thumb,
.pp-card-area::-webkit-scrollbar-thumb,
.pp-tab-content::-webkit-scrollbar-thumb,
.pp-person-sidebar::-webkit-scrollbar-thumb,
.kanban-board::-webkit-scrollbar-thumb,
.kanban-col-body::-webkit-scrollbar-thumb,
.inv-table-wrap::-webkit-scrollbar-thumb,
.inv-detail-body::-webkit-scrollbar-thumb,
.cpd-main::-webkit-scrollbar-thumb,
.cpd-sidebar::-webkit-scrollbar-thumb,
.notif-list::-webkit-scrollbar-thumb {
	background: transparent;
	border-radius: 99px;
	transition: background 0.25s ease;
}
.table-wrap:hover::-webkit-scrollbar-thumb,
.qv-body:hover::-webkit-scrollbar-thumb,
.pp-left:hover::-webkit-scrollbar-thumb,
.pp-card-area:hover::-webkit-scrollbar-thumb,
.pp-tab-content:hover::-webkit-scrollbar-thumb,
.pp-person-sidebar:hover::-webkit-scrollbar-thumb,
.kanban-board:hover::-webkit-scrollbar-thumb,
.kanban-col-body:hover::-webkit-scrollbar-thumb,
.inv-table-wrap:hover::-webkit-scrollbar-thumb,
.inv-detail-body:hover::-webkit-scrollbar-thumb,
.cpd-main:hover::-webkit-scrollbar-thumb,
.cpd-sidebar:hover::-webkit-scrollbar-thumb,
.notif-list:hover::-webkit-scrollbar-thumb {
	background: var(--sb-thumb);
}
.table-wrap:hover::-webkit-scrollbar-thumb:hover,
.qv-body:hover::-webkit-scrollbar-thumb:hover,
.pp-left:hover::-webkit-scrollbar-thumb:hover,
.pp-card-area:hover::-webkit-scrollbar-thumb:hover,
.pp-tab-content:hover::-webkit-scrollbar-thumb:hover,
.pp-person-sidebar:hover::-webkit-scrollbar-thumb:hover,
.kanban-board:hover::-webkit-scrollbar-thumb:hover,
.kanban-col-body:hover::-webkit-scrollbar-thumb:hover,
.inv-table-wrap:hover::-webkit-scrollbar-thumb:hover,
.inv-detail-body:hover::-webkit-scrollbar-thumb:hover,
.cpd-main:hover::-webkit-scrollbar-thumb:hover,
.cpd-sidebar:hover::-webkit-scrollbar-thumb:hover,
.notif-list:hover::-webkit-scrollbar-thumb:hover {
	background: var(--sb-thumb-hover);
}

/* ── SIDEBAR HOVER EXPAND (A1) ── */
.sidebar {
	width: 52px;
	overflow: hidden;
	transition: width 0.28s ease;
}
.sidebar:hover {
	width: var(--sidebar-w);
}
.sidebar .sidebar-logo-text,
.sidebar .nav-label,
.sidebar .user-info,
.sidebar .btn-signout {
	white-space: nowrap;
	opacity: 0;
	transition: opacity 0.15s ease;
	pointer-events: none;
}
.sidebar:hover .sidebar-logo-text,
.sidebar:hover .nav-label,
.sidebar:hover .user-info,
.sidebar:hover .btn-signout {
	opacity: 1;
	pointer-events: auto;
}
/* Center icons when collapsed; hide nav scroll */
.sidebar:not(:hover) .sidebar-nav {
	overflow: hidden;
}
.sidebar:not(:hover) .sidebar-header {
	padding: 14px 8px;
}
.sidebar:not(:hover) .nav-item {
	padding: 8px 9px;
}
.sidebar:not(:hover) .user-chip {
	padding: 10px 0;
}

.sidebar-nav {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 12px 8px;
	flex: 1;
	overflow-y: auto;
}
.sidebar-footer {
	padding: 12px 8px 16px;
	border-top: 1px solid #ffffff1a;
}

.nav-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	border-radius: 6px;
	color: var(--color-sidebar-txt);
	font-size: 14px;
	font-weight: 500;
	transition:
		background 0.12s,
		color 0.12s;
}
.nav-item:hover {
	background: var(--color-sidebar-h);
	color: var(--color-sidebar-act);
}
.nav-item.active {
	background: var(--color-primary);
	color: white;
}
.nav-icon {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
}
.nav-label {
	white-space: nowrap;
}

.user-chip {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border-radius: 6px;
	margin-top: 4px;
}
.user-avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: var(--color-primary);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 700;
	color: white;
	flex-shrink: 0;
}
.user-info {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-width: 0;
}
.user-name {
	font-size: 13px;
	font-weight: 600;
	color: var(--color-sidebar-act);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.user-role {
	font-size: 11px;
	color: var(--color-sidebar-txt);
}
.btn-signout {
	background: none;
	border: none;
	color: var(--color-sidebar-txt);
	padding: 4px;
	border-radius: 4px;
	display: flex;
	align-items: center;
	transition:
		color 0.12s,
		background 0.12s;
}
.btn-signout:hover {
	color: var(--color-sidebar-act);
	background: #ffffff15;
}

/* ── MAIN CONTENT ── */
.main-content {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	margin-left: 52px;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

/* ── LOADING ── */
.view-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 1;
	height: 100vh;
}
.spinner {
	width: 36px;
	height: 36px;
	border: 3px solid var(--color-border);
	border-top-color: var(--color-primary);
	border-radius: 50%;
	animation: spin 0.7s linear infinite;
}
@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

/* ── PAGE HEADER (dashboard / placeholders) ── */
.page-header {
	display: grid;
	grid-template-columns: 250px auto 1fr;
	align-items: center;
	gap: 16px;
	padding: 16px 32px;
	background: var(--color-surface);
	position: sticky;
	top: 0;
	z-index: 10;
	min-height: 64px;
	box-shadow:
		0 1px 0 #e2e8f0,
		0 2px 8px rgba(0, 0, 0, 0.04);
}
.page-header-left {
}
.page-greeting {
	font-size: 13px;
	color: var(--color-muted);
}
.page-title {
	font-size: 22px;
	font-weight: 700;
}
.page-title-count {
	font-size: 14px;
	font-weight: 500;
	color: var(--color-muted);
	margin-left: 4px;
}
.page-subtitle {
	font-size: 13px;
	color: var(--color-muted);
	margin-top: 2px;
}
.page-header-right {
	display: flex;
	align-items: center;
	gap: 8px;
	justify-content: flex-end;
}

/* ── BUTTONS ── */
.btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	border-radius: var(--radius);
	font-size: 14px;
	font-weight: 500;
	border: 1.5px solid transparent;
	transition: all 0.12s;
}
.btn-primary {
	background: var(--color-primary);
	color: white;
	border-color: var(--color-primary);
}
.btn-primary:hover {
	background: var(--color-primary-h);
	border-color: var(--color-primary-h);
}
.btn-outline {
	background: white;
	color: var(--color-text);
	border-color: var(--color-border);
}
.btn-outline:hover {
	border-color: #94a3b8;
	background: #f8fafc;
}
.btn-danger {
	background: #fef2f2;
	color: var(--color-danger);
	border-color: #fecaca;
}
.btn-danger:hover {
	background: #fee2e2;
}
.btn-primary:active {
	transform: translateY(1px);
}
.btn-outline:active {
	transform: translateY(1px);
}
.btn-danger:active {
	transform: translateY(1px);
}
.btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}
.btn-sm {
	padding: 6px 12px;
	font-size: 13px;
}

/* ── CARDS ── */
.card {
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
}

/* ── EMPTY STATE ── */
.empty-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 80px 40px;
	text-align: center;
}
.empty-state-icon {
	font-size: 48px;
	margin-bottom: 16px;
	opacity: 0.4;
}
.empty-state-title {
	font-size: 18px;
	font-weight: 600;
	margin-bottom: 8px;
}
.empty-state-sub {
	color: var(--color-muted);
	max-width: 360px;
	line-height: 1.5;
}
/* Reusable inline empty state (renderEmptyState util) */
.empty-state-generic {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 24px 16px;
	color: var(--color-muted);
	font-size: 13px;
}
.empty-state-msg {
	font-weight: 400;
}
.empty-state-cta {
	white-space: nowrap;
}

/* ── ACCESS DENIED ── */
.access-denied {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	flex: 1;
	padding: 80px;
	text-align: center;
}
.access-denied h2 {
	font-size: 20px;
	font-weight: 700;
	margin-bottom: 8px;
	color: var(--color-danger);
}
.access-denied p {
	color: var(--color-muted);
}

/* ── PEOPLE MODULE — single-line topbar ── */
.view-topbar {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 24px;
	border-bottom: 1px solid var(--color-border);
	background: var(--color-surface);
	min-height: 48px;
}

.view-topbar-title {
	display: flex;
	flex-direction: column;
	min-width: 90px;
	flex-shrink: 0;
}
.view-topbar-title .page-title {
	font-size: 17px;
	line-height: 1.2;
	margin: 0;
}
.view-topbar-title .page-subtitle {
	font-size: 12px;
	color: var(--color-muted);
	margin-top: 1px;
}

.search-wrap {
	position: relative;
	display: flex;
	align-items: center;
}
.search-wrap svg {
	position: absolute;
	left: 10px;
	color: var(--color-muted);
	pointer-events: none;
}
.search-input-bar {
	width: 440px;
	padding: 6px 12px 6px 32px;
	border-radius: var(--radius);
	border: 1.5px solid var(--color-border);
	font-size: 13px;
	color: var(--color-text);
	background: white;
	outline: none;
	transition:
		border-color 0.15s,
		width 0.2s ease;
}
.search-input-bar::placeholder {
	color: var(--color-muted);
}
.search-input-bar:focus {
	border-color: var(--color-primary);
}

/* Filter tabs */
.filter-tabs {
	display: flex;
	align-items: center;
	gap: 2px;
}
.filter-tab {
	background: none;
	border: none;
	padding: 5px 12px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 500;
	color: var(--color-muted);
	transition:
		background 0.12s,
		color 0.12s;
	cursor: pointer;
	white-space: nowrap;
}
.filter-tab:hover {
	background: #f1f5f9;
	color: var(--color-text);
}
.filter-tab.active {
	background: #eff6ff;
	color: var(--color-primary);
	font-weight: 600;
}

.btn-filter {
	background: none;
	border: 1.5px solid var(--color-border);
	color: var(--color-muted);
	padding: 5px 10px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 500;
	display: flex;
	align-items: center;
	gap: 5px;
	transition: all 0.12s;
	cursor: pointer;
}
.btn-filter:hover {
	border-color: #94a3b8;
	color: var(--color-text);
	background: #f8fafc;
}

.view-topbar-actions {
	margin-left: auto;
	flex-shrink: 0;
}

/* ── TABLE ── */
.table-wrap {
	overflow-x: auto;
	overflow-y: auto;
	max-height: calc(100vh - 64px);
}
.data-table {
	width: 100%;
	border-collapse: collapse;
	background: white;
}
.data-table thead {
	background: #f8fafc;
	border-bottom: 1.5px solid var(--color-border);
}
.data-table th {
	text-align: left;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #94a3b8;
	padding: 10px 16px;
	white-space: nowrap;
}
.data-table td {
	padding: 18px 16px;
	border-bottom: 1px solid #f1f5f9;
	vertical-align: middle;
}
.data-table tbody tr:last-child td {
	border-bottom: none;
}
.th-sort {
	cursor: pointer;
	user-select: none;
}
.th-sort:hover {
	color: var(--color-text);
}
.th-sort.sort-asc,
.th-sort.sort-desc {
	color: var(--color-primary);
}
.sort-arrow {
	font-style: normal;
	font-size: 11px;
}
.table-row {
	transition: background 0.1s;
	cursor: pointer;
}
.table-row:hover {
	background: #f8fafc;
}
.td-name {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 500;
	/* width: 22%; */
	/* max-width: 220px; */
	overflow: hidden;
}
.td-name span {
	color: var(--color-muted);
	font-weight: 400;
}
.td-muted {
	color: var(--color-muted);
	font-size: 13px;
}
.td-active-case {
	font-size: 13px;
	line-height: 1.4;
}
.pp-active-case {
	display: block;
	font-weight: 500;
	color: var(--color-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 180px;
}
.pp-active-stage {
	display: block;
	font-size: 11px;
	color: var(--color-muted);
}

.person-avatar {
	width: 25px;
	height: 25px;
	border-radius: 50%;
	background: #e0e7ff;
	color: white;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 9px;
	font-weight: 700;
	flex-shrink: 0;
}

.email-link {
	color: var(--color-muted);
	text-decoration: none;
}
.email-link:hover {
	color: var(--color-primary);
	text-decoration: underline;
}

/* ── CHECKBOX COLUMN ── */
.th-check,
.td-check {
	width: 40px;
	padding: 0 0 0 16px !important;
}
.th-check input,
.td-check input {
	cursor: pointer;
	width: 15px;
	height: 15px;
	accent-color: var(--color-primary);
}
.row-selected {
	background: #eff6ff !important;
}

/* ── ROW QUICK ACTIONS ── */
.th-actions {
	width: 148px;
}
.td-actions {
	width: 148px;
	padding: 0 12px 0 0 !important;
}
.row-actions {
	display: flex;
	align-items: center;
	gap: 2px;
	opacity: 0.8;
	transition: opacity 0.15s;
}
.table-row:hover .row-actions {
	opacity: 1;
}
.row-action-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 6px;
	border: none;
	background: transparent;
	color: #94a3b8;
	cursor: pointer;
	transition:
		background 0.12s,
		color 0.12s;
	text-decoration: none;
}
.row-action-btn:hover {
	background: #e2e8f0;
	color: #1e293b;
}
.row-action-btn[disabled] {
	opacity: 0.3;
	cursor: default;
	pointer-events: none;
}

/* ── QUICK-ADD DROPDOWN ── */
.quick-add-dropdown {
	position: absolute;
	z-index: 200;
	background: white;
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	box-shadow: var(--shadow-md);
	min-width: 200px;
	padding: 6px;
}
.quick-add-label {
	font-size: 11px;
	color: var(--color-muted);
	padding: 4px 8px 6px;
	border-bottom: 1px solid var(--color-border);
	margin-bottom: 4px;
}
.quick-add-item {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	padding: 7px 10px;
	border: none;
	background: transparent;
	font-size: 13px;
	color: var(--color-text);
	border-radius: 6px;
	cursor: pointer;
	text-align: left;
}
.quick-add-item:hover {
	background: #f8fafc;
}

.table-empty {
	text-align: center;
	padding: 48px 16px !important;
	color: var(--color-muted);
	font-size: 13px;
}
.table-error {
	color: var(--color-danger);
}
.table-spinner {
	width: 24px;
	height: 24px;
	border: 2px solid var(--color-border);
	border-top-color: var(--color-primary);
	border-radius: 50%;
	animation: spin 0.7s linear infinite;
	margin: 0 auto;
}

.badge {
	display: inline-block;
	padding: 2px 9px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
}
/* Type badges — colored chips
 * NAMING STANDARD: use badge-* for all new features. pill-* classes exist for legacy — do not rename (breaks JS classList checks).
 */
.badge-lead {
	background: #fef3c7;
	color: #92400e;
}
.badge-client {
	background: #dcfce7;
	color: #15803d;
}
.badge-past {
	background: #f1f5f9;
	color: #475569;
}
.badge-potential {
	background: #ede9fe;
	color: #6d28d9;
}

/* ── BULK ACTION BAR ── */
.bulk-bar {
	position: fixed;
	bottom: 32px;
	left: 50%;
	transform: translateX(-50%) translateY(20px);
	background: #1e293b;
	color: white;
	border-radius: 12px;
	padding: 12px 20px;
	display: flex;
	align-items: center;
	gap: 12px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
	opacity: 0;
	pointer-events: none;
	transition:
		opacity 0.2s,
		transform 0.2s;
	z-index: 300;
	white-space: nowrap;
}
.bulk-bar.visible {
	opacity: 1;
	pointer-events: all;
	transform: translateX(-50%) translateY(0);
}
.bulk-bar-count {
	font-size: 13px;
	font-weight: 600;
	margin-right: 4px;
}
.bulk-btn {
	background: rgba(255, 255, 255, 0.12);
	border: none;
	color: white;
	border-radius: 8px;
	padding: 6px 14px;
	font-size: 13px;
	cursor: pointer;
	transition: background 0.12s;
}
.bulk-btn:hover {
	background: rgba(255, 255, 255, 0.22);
}
.bulk-btn-danger {
	background: rgba(239, 68, 68, 0.25);
}
.bulk-btn-danger:hover {
	background: rgba(239, 68, 68, 0.45);
}
.bulk-dismiss {
	background: none;
	border: none;
	color: rgba(255, 255, 255, 0.5);
	font-size: 20px;
	cursor: pointer;
	padding: 0 2px;
	line-height: 1;
	margin-left: 4px;
}
.bulk-dismiss:hover {
	color: white;
}

/* ── EMAIL MODAL ── */
.modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	z-index: 400;
	display: flex;
	align-items: center;
	justify-content: center;
}
.modal-box,
.modal-dialog {
	background: white;
	border-radius: 12px;
	width: 560px;
	max-width: 95vw;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
	overflow: hidden;
}
.modal-header {
	padding: 20px 24px;
	border-bottom: 1px solid var(--color-border);
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.modal-title {
	font-size: 16px;
	font-weight: 700;
}
.modal-close {
	background: none;
	border: none;
	font-size: 22px;
	cursor: pointer;
	color: #94a3b8;
	line-height: 1;
}
.modal-close:hover {
	color: #1e293b;
}
.modal-body {
	padding: 20px 24px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.modal-label {
	font-size: 11px;
	font-weight: 700;
	color: #64748b;
	letter-spacing: 0.05em;
	margin-bottom: 4px;
}
.modal-input {
	width: 100%;
	padding: 8px 12px;
	border: 1.5px solid var(--color-border);
	border-radius: 8px;
	font-size: 13px;
	font-family: inherit;
	box-sizing: border-box;
}
.modal-input:focus {
	outline: none;
	border-color: var(--color-primary);
}
.modal-textarea {
	min-height: 130px;
	resize: vertical;
}
.modal-vars {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}
.var-chip {
	font-size: 11px;
	background: #f1f5f9;
	border: 1px solid #e2e8f0;
	border-radius: 4px;
	padding: 3px 8px;
	cursor: pointer;
	font-family: monospace;
	color: #3b82f6;
	transition: background 0.12s;
	user-select: none;
}
.var-chip:hover {
	background: #dbeafe;
}
.modal-preview {
	background: #f8fafc;
	border: 1px solid var(--color-border);
	border-radius: 8px;
	padding: 12px;
	font-size: 12px;
	color: #475569;
	white-space: pre-wrap;
	min-height: 56px;
	line-height: 1.6;
}
.modal-footer {
	padding: 16px 24px;
	border-top: 1px solid var(--color-border);
	display: flex;
	justify-content: flex-end;
	gap: 8px;
}
.modal-check-row {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	font-size: 13px;
	color: var(--color-text);
	padding: 8px 0;
}
.modal-check-row input[type="checkbox"] {
	width: 16px;
	height: 16px;
	accent-color: var(--color-primary);
	cursor: pointer;
}
#new-case-urgency {
	accent-color: #f59e0b;
}
input[type="date"].modal-input,
.modal-input[type="date"],
input[type="date"] {
	font-family: inherit;
	font-size: 13px;
	color: var(--color-text);
}
.urgency-toggle {
	display: flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
	font-size: 13px;
	color: var(--color-text);
}
.urgency-toggle input[type="checkbox"] {
	width: 15px;
	height: 15px;
	accent-color: #ef4444;
	cursor: pointer;
}
.urgency-toggle input:checked + span {
	color: #ef4444;
	font-weight: 600;
}

/* ── QUICK VIEW PANEL ── */
.qv-backdrop {
	position: fixed;
	inset: 0;
	z-index: 200;
	pointer-events: none;
	background: transparent;
	transition: background 0.2s;
}
.qv-backdrop.qv-open {
	pointer-events: all;
	background: rgba(0, 0, 0, 0.28);
}

.qv-panel {
	position: fixed;
	top: 0;
	right: 0;
	height: 100vh;
	width: 420px;
	max-width: 95vw;
	background: white;
	border-left: 1px solid var(--color-border);
	box-shadow: -8px 0 40px rgba(0, 0, 0, 0.12);
	transform: translateX(100%);
	transition: transform 0.22s ease;
	z-index: 201;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}
.qv-panel.qv-open {
	transform: translateX(0);
}

/* Header: identity left, controls right */
.qv-header {
	padding: 14px 16px 12px;
	border-bottom: 1px solid var(--color-border);
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
	gap: 10px;
}
.qv-header-identity {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	flex: 1;
}
.qv-hd-avatar {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 14px;
	color: white;
	flex-shrink: 0;
}
.qv-hd-text {
	min-width: 0;
}
.qv-hd-name {
	font-size: 25px;
	font-weight: 700;
	color: var(--color-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.qv-header-controls {
	display: flex;
	align-items: center;
	gap: 20px;
	flex-shrink: 0;
}

/* Always-visible contact bar */
.qv-contact-bar {
	padding: 8px 16px;
	border-bottom: 1px solid var(--color-border);
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex-shrink: 0;
}
.qv-cb-row {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 3px 4px;
	border-radius: 6px;
}
.qv-cb-row:hover {
	background: #f8fafc;
}
.qv-cb-icon {
	color: #9ca3af;
	display: flex;
	align-items: center;
	flex-shrink: 0;
}
.qv-cb-val {
	font-size: 13px;
	font-weight: 400;
	color: #374151;
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.qv-cb-val.empty {
	color: var(--color-border-strong);
}
.qv-cb-val.qv-copy {
	cursor: pointer;
}
.qv-cb-val.qv-copy:hover {
	color: var(--color-primary);
}
.qv-cb-copy {
	opacity: 0;
	background: none;
	border: none;
	cursor: pointer;
	color: #9ca3af;
	padding: 2px;
	border-radius: 4px;
	display: flex;
	align-items: center;
	transition: opacity 0.1s;
	flex-shrink: 0;
}
.qv-cb-row:hover .qv-cb-copy {
	opacity: 1;
}
.qv-cb-copy:hover {
	color: var(--color-primary);
}

.qv-icon-btn {
	background: none;
	border: none;
	color: #94a3b8;
	cursor: pointer;
	padding: 4px;
	border-radius: 6px;
	display: flex;
	align-items: center;
	transition:
		color 0.12s,
		background 0.12s;
}
.qv-icon-btn:hover {
	color: var(--color-text);
	background: #f1f5f9;
}
.qv-close-btn {
	background: none;
	border: none;
	font-size: 20px;
	color: #94a3b8;
	cursor: pointer;
	padding: 2px 4px;
	line-height: 1;
}
.qv-close-btn:hover {
	color: var(--color-text);
}

/* Body */
.qv-body {
	flex: 1;
	overflow-y: auto;
	padding: 16px 16px;
	display: flex;
	flex-direction: column;
	gap: 20px;
}

/* Body name */
.qv-body-name {
	font-size: 17px;
	font-weight: 700;
	color: var(--color-text);
	padding: 0 2px 4px;
}

/* Contact rows — icon + label + value + hover-copy btn */
.qv-section {
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.qv-section-title-row {
	display: flex;
	align-items: center;
	gap: 6px;
	padding-bottom: 6px;
	border-bottom: 1px solid var(--color-border);
	margin-top: 4px;
}
.qv-section-title-row-editable {
	cursor: pointer;
}
.qv-section-title {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--color-muted);
}
.qv-section-add {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 16px;
	color: var(--color-muted);
	line-height: 1;
	padding: 0 2px;
	border-radius: 4px;
	transition:
		color 0.12s,
		background 0.12s;
}
.qv-section-add:hover {
	color: var(--color-primary);
	background: #e0e7ff;
}
.qv-section-edit {
	background: none;
	border: none;
	cursor: pointer;
	color: var(--color-border-strong);
	padding: 3px 5px;
	border-radius: 4px;
	display: flex;
	align-items: center;
	transition:
		opacity 0.15s,
		color 0.15s;
}
.qv-section-title-row:hover .qv-section-edit {
	color: #94a3b8;
}
.qv-section-edit:hover {
	color: var(--color-primary);
	background: #e0e7ff;
}
.qv-edit-input {
	flex: 1;
	font-size: 13px;
	border: 1px solid var(--color-border-strong);
	border-radius: 4px;
	padding: 3px 7px;
	outline: none;
	color: var(--color-text);
	background: white;
	min-width: 0;
	font-family: inherit;
}
.qv-edit-input:focus {
	border-color: var(--color-primary);
	box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.12);
}
.qv-edit-actions {
	display: flex;
	gap: 6px;
	padding: 6px 6px 2px;
}
.qv-save-edit-btn {
	font-size: 12px;
	padding: 4px 12px;
	border-radius: 6px;
	border: none;
	background: var(--color-primary);
	color: white;
	cursor: pointer;
	font-weight: 500;
	font-family: inherit;
}
.qv-save-edit-btn:hover {
	background: #4f46e5;
}
.qv-cancel-edit-btn {
	font-size: 12px;
	padding: 4px 10px;
	border-radius: 6px;
	border: 1px solid #e2e8f0;
	background: white;
	color: #64748b;
	cursor: pointer;
	font-family: inherit;
}
.qv-cancel-edit-btn:hover {
	background: #f8fafc;
}
.pp-ver-mais-btn {
	width: 100%;
	padding: 8px;
	border: 1px dashed #e2e8f0;
	border-radius: 6px;
	background: none;
	color: #64748b;
	font-size: 12px;
	cursor: pointer;
	text-align: center;
	margin-top: 4px;
	font-family: inherit;
}
.pp-ver-mais-btn:hover {
	background: #f8fafc;
	color: var(--color-primary);
	border-color: #c7d2fe;
}
/* Load-more fixed bar at viewport bottom */
.load-more-fixed {
	position: fixed;
	bottom: 0;
	left: var(--sidebar-w);
	right: 0;
	z-index: 50;
	border-radius: 0;
	border: none;
	border-top: 1px solid var(--color-border);
	padding: 13px;
	background: var(--color-surface);
	font-size: 13px;
	font-weight: 500;
	color: var(--color-primary);
	box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
}
.load-more-fixed:hover {
	background: #f1f5f9;
}
.sidebar.collapsed ~ .main-content .load-more-fixed {
	left: 52px;
}
.qv-contact-row {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 5px 6px;
	border-radius: 6px;
}
.qv-contact-row:hover {
	background: #f1f5f9;
}
.qv-cr-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	color: var(--color-muted);
	flex-shrink: 0;
}
.qv-cr-label {
	font-size: 12px;
	color: var(--color-muted);
	width: 68px;
	flex-shrink: 0;
}
.qv-cr-content {
	display: flex;
	align-items: center;
	gap: 6px;
	flex: 1;
	min-width: 0;
}
.qv-cr-val {
	font-size: 13px;
	color: var(--color-text);
	word-break: break-word;
	line-height: 1.5;
	flex: 1;
}
.qv-cr-val.empty {
	color: var(--color-border-strong);
}
.qv-cr-val.qv-copy {
	cursor: pointer;
}
.qv-cr-val.qv-copy:hover {
	color: var(--color-primary);
}
.qv-cr-copy {
	background: none;
	border: none;
	cursor: pointer;
	color: var(--color-muted);
	padding: 2px;
	display: flex;
	align-items: center;
	border-radius: 4px;
	opacity: 0;
	transition:
		opacity 0.12s,
		color 0.12s;
}
.qv-contact-row:hover .qv-cr-copy {
	opacity: 1;
}
.qv-cr-copy:hover {
	color: var(--color-primary);
	background: #e2e8f0;
}
.qv-ver-mais {
	background: none;
	border: none;
	padding: 4px 6px;
	font-size: 12px;
	color: var(--color-muted);
	cursor: pointer;
	text-align: left;
	margin-top: 2px;
}
.qv-ver-mais:hover {
	color: var(--color-primary);
}
.qv-extra {
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.qv-extra[hidden] {
	display: none;
}
.qv-link {
	color: var(--color-primary);
	text-decoration: none;
}
.qv-link:hover {
	text-decoration: underline;
}

/* Opp / Case list items */
.qv-list-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 8px 10px;
	border-radius: 8px;
	background: #f8fafc;
	border: 1px solid var(--color-border);
	font-size: 13px;
}
.qv-list-name {
	flex: 1;
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.qv-badge {
	font-size: 11px;
	font-weight: 600;
	padding: 2px 8px;
	border-radius: 99px;
	flex-shrink: 0;
}
.qv-badge-open {
	background: #dbeafe;
	color: #1d4ed8;
}
.qv-badge-won {
	background: #dcfce7;
	color: #15803d;
}
.qv-badge-lost {
	background: #fee2e2;
	color: #b91c1c;
}
.qv-badge-active {
	background: #dcfce7;
	color: #15803d;
}
.qv-badge-closed {
	background: #f1f5f9;
	color: #64748b;
}
.qv-empty-section {
	font-size: 12px;
	color: var(--color-muted);
	padding: 4px 0;
	font-style: italic;
	display: flex;
	align-items: center;
	gap: 8px;
}
.qv-empty-cta {
	font-style: normal;
	font-size: 12px;
	font-weight: 500;
	color: var(--color-primary);
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
}
.qv-loading {
	display: flex;
	justify-content: center;
	padding: 48px 0;
}

/* ── PERSON DETAIL PAGE ── */
.person-page {
	display: flex;
	flex-direction: column;
	flex: 1;
	overflow: hidden;
	min-height: 0;
	height: 100vh;
}

/* Sub-topbar */
.pp-sub-topbar {
	height: 48px;
	background: white;
	border-bottom: 1px solid var(--color-border);
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 20px;
	flex-shrink: 0;
}
.pp-back-btn {
	display: flex;
	align-items: center;
	gap: 6px;
	background: none;
	border: none;
	cursor: pointer;
	font-size: 13px;
	color: #64748b;
	font-weight: 500;
	padding: 6px 10px;
	border-radius: 6px;
	transition:
		background 0.12s,
		color 0.12s;
}
.pp-back-btn:hover {
	background: #f1f5f9;
	color: var(--color-text);
}
.pp-sub-actions {
	display: flex;
	align-items: center;
	gap: 8px;
}
.pp-action-btn {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 500;
	padding: 6px 14px;
	border-radius: 6px;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.12s;
}
.pp-action-email {
	background: white;
	border: 1px solid var(--color-border);
	color: var(--color-primary);
}
.pp-action-email:hover {
	background: #f8fafc;
}

/* Card area */
.pp-card-area {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
}
.pp-contact-card {
	background: white;
	border: 1px solid var(--color-border);
	border-radius: 8px;
	display: flex;
	flex-direction: row;
	flex: 1;
	min-height: 500px;
	overflow: hidden;
}

/* Left panel */
.pp-left {
	width: 280px;
	flex-shrink: 0;
	border-right: 1px solid var(--color-border);
	overflow-y: auto;
	padding: 28px 22px;
	display: flex;
	flex-direction: column;
	gap: 0;
}
.pp-profile-section {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding-bottom: 20px;
	margin-bottom: 20px;
	border-bottom: 1px solid var(--color-border);
}
.pp-profile-avatar {
	width: 80px;
	height: 80px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 28px;
	color: white;
	margin-bottom: 14px;
	box-shadow: var(--shadow-md);
}
.pp-profile-name {
	font-size: 19px;
	font-weight: 700;
	color: var(--color-text);
	text-align: center;
	margin-bottom: 4px;
	line-height: 1.3;
}
.pp-profile-type {
	display: flex;
	justify-content: center;
}
.pp-profile-type-muted {
	font-size: 12px;
	color: #94a3b8;
	text-align: center;
}

/* Info blocks */
.pp-info-block {
	margin-bottom: 20px;
}
.pp-info-block:last-child {
	margin-bottom: 0;
}
.pp-info-block-label {
	font-size: 12px;
	font-weight: 600;
	color: #94a3b8;
	margin-bottom: 10px;
}
.pp-info-field {
	padding: 4px 0;
}
.pp-info-field-label {
	font-size: 11px;
	color: #aab0bc;
	margin-bottom: 2px;
}
.pp-info-field-value {
	font-size: 13px;
	color: var(--color-text);
	line-height: 1.4;
}
.pp-info-copyable {
	color: var(--color-primary);
	cursor: pointer;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	display: block;
}
.pp-info-copyable:hover {
	text-decoration: underline;
}

/* Right panel */
.pp-right {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-width: 0;
	background: white;
}

/* Tab bar */
.pp-tab-bar {
	display: flex;
	align-items: center;
	gap: 0;
	padding: 0 20px;
	background: white;
	flex-shrink: 0;
	border-bottom: 1px solid var(--color-border);
}
.pp-tab {
	background: none;
	border: none;
	border-bottom: 2px solid transparent;
	padding: 13px 16px;
	font-size: 13px;
	font-weight: 500;
	color: #64748b;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 7px;
	transition:
		color 0.15s,
		border-color 0.15s;
	margin-bottom: -1px;
}
.pp-tab:hover {
	color: var(--color-text);
}
.pp-tab.active {
	color: var(--color-primary);
	border-bottom-color: var(--color-primary);
	font-weight: 600;
}
.pp-tab-count {
	background: #f1f5f9;
	color: #64748b;
	font-size: 11px;
	font-weight: 600;
	padding: 1px 7px;
	border-radius: 99px;
	min-width: 18px;
	text-align: center;
}
.pp-tab.active .pp-tab-count {
	background: #dbeafe;
	color: #1d4ed8;
}

/* Tab content */
.pp-tab-content {
	flex: 1;
	overflow-y: auto;
	padding: 20px 24px;
	display: flex;
	flex-direction: column;
}
.pp-tab-panel {
	display: flex;
	flex-direction: column;
	gap: 16px;
}
.pp-tab-panel.hidden {
	display: none;
}

/* Entity cards (opps/cases in tabs) */
a.pp-entity-card { text-decoration: none; color: inherit; }
.pp-entity-card {
	background: white;
	border: 1px solid var(--color-border);
	border-radius: 8px;
	padding: 14px 18px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	cursor: pointer;
	transition:
		border-color 0.15s,
		box-shadow 0.15s;
}
.pp-entity-card:hover {
	border-color: #93c5fd;
	box-shadow: 0 2px 8px rgba(59, 130, 246, 0.08);
}
.pp-entity-title {
	font-size: 14px;
	font-weight: 600;
	color: var(--color-text);
}
.pp-entity-sub {
	font-size: 12px;
	color: var(--color-muted);
	margin-top: 3px;
}
.pp-entity-right {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

/* Shared badges */
.pp-badge {
	font-size: 11px;
	font-weight: 600;
	padding: 3px 9px;
	border-radius: 99px;
	flex-shrink: 0;
}
.pp-badge-open {
	background: #dbeafe;
	color: #1d4ed8;
}
.pp-badge-won {
	background: #dcfce7;
	color: #15803d;
}
.pp-badge-lost {
	background: #fee2e2;
	color: #b91c1c;
}
.pp-badge-active {
	background: #dcfce7;
	color: #15803d;
}
.pp-badge-closed,
.pp-badge-complete {
	background: #f1f5f9;
	color: #64748b;
}
.pp-badge-submitted {
	background: #fef3c7;
	color: #92400e;
}
.pp-empty {
	font-size: 13px;
	color: var(--color-muted);
	font-style: italic;
	padding: 8px 0;
}

/* ── GERAL TAB ── */
.geral-section {
	margin-bottom: 24px;
}
.geral-section-title {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	color: var(--color-muted);
	margin-bottom: 10px;
	display: flex;
	align-items: center;
	gap: 6px;
}
.geral-entity-list {
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.geral-ver-mais {
	font-size: 12px;
	color: var(--color-muted);
	margin-top: 8px;
}
.geral-activity-row {
	display: flex;
	gap: 10px;
	margin-top: 4px;
}
.geral-activity-btn {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: var(--color-text);
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: 8px;
	padding: 10px 16px;
	cursor: pointer;
	flex: 1;
	transition: border-color 0.15s, box-shadow 0.15s;
}
.geral-activity-btn:hover {
	border-color: #93c5fd;
	box-shadow: 0 2px 8px rgba(59,130,246,0.08);
}
.geral-activity-btn svg {
	color: var(--color-muted);
	flex-shrink: 0;
}
.geral-note-item {
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: 8px;
	padding: 12px 14px;
}
.geral-note-meta {
	font-size: 11px;
	color: var(--color-muted);
	margin-bottom: 4px;
}
.geral-note-body {
	font-size: 13px;
	color: var(--color-text);
	white-space: pre-wrap;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
}
.geral-task-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: 8px;
	padding: 10px 14px;
	font-size: 13px;
}
.geral-task-title {
	font-weight: 500;
	color: var(--color-text);
}
.geral-task-meta {
	font-size: 11px;
	color: var(--color-muted);
	margin-top: 2px;
}

/* ── DASHBOARD ── */
.dashboard-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 16px;
	padding: 32px;
}
.stat-card {
	padding: 24px;
	border-radius: var(--radius);
}
.stat-value {
	font-size: 2.6rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	margin-bottom: 4px;
}
.stat-label {
	font-size: 13px;
	color: var(--color-muted);
}
.stat-card.blue {
	background: #eff6ff;
	border: 1px solid #bfdbfe;
}
.stat-card.blue .stat-value {
	color: var(--color-primary);
}
.stat-card.green {
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
}
.stat-card.green .stat-value {
	color: var(--color-success);
}
.stat-card.orange {
	background: #fff7ed;
	border: 1px solid #fed7aa;
}
.stat-card.orange .stat-value {
	color: #ea580c;
}
.stat-card.purple {
	background: #faf5ff;
	border: 1px solid #e9d5ff;
}
.stat-card.purple .stat-value {
	color: #7c3aed;
}

/* ── OPPORTUNITIES ── */

/* Status badges — open/active neutral, won/lost retain color (#11/#49) */
.badge-opp-open {
	background: #f1f5f9;
	color: #475569;
	border-radius: 6px;
	padding: 2px 8px;
	font-size: 12px;
	font-weight: 500;
}
.badge-opp-won {
	background: #f0fdf4;
	color: var(--color-success);
	border-radius: 6px;
	padding: 2px 8px;
	font-size: 12px;
	font-weight: 500;
}
.badge-opp-lost {
	background: #fef2f2;
	color: #dc2626;
	border-radius: 6px;
	padding: 2px 8px;
	font-size: 12px;
	font-weight: 500;
}

/* Stage pill */
.stage-pill {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 500;
	background: #f1f5f9;
	color: #475569;
}

/* Status filter chips */
.opp-status-filter {
	display: flex;
	gap: 4px;
}
.filter-chip {
	padding: 5px 12px;
	border: 1.5px solid var(--color-border);
	border-radius: 20px;
	font-size: 12px;
	font-weight: 500;
	background: white;
	color: var(--color-muted);
	cursor: pointer;
	transition: all 0.12s;
}
.filter-chip:hover {
	border-color: var(--color-primary);
	color: var(--color-primary);
}
.filter-chip.active {
	background: var(--color-primary);
	border-color: var(--color-primary);
	color: white;
}

/* View toggle — segmented control neutro */
.view-toggle-btns {
	display: flex;
	background: #f1f5f9;
	border: 1px solid var(--color-border);
	border-radius: 8px;
	padding: 2px;
	gap: 2px;
}
.view-btn {
	padding: 4px 8px;
	background: transparent;
	border: none;
	cursor: pointer;
	color: var(--color-muted);
	display: flex;
	align-items: center;
	border-radius: 6px;
	transition:
		background 0.12s,
		color 0.12s,
		box-shadow 0.12s;
}
.view-btn:hover {
	background: rgba(255, 255, 255, 0.7);
	color: var(--color-text);
}
.view-btn.active {
	background: white;
	color: var(--color-text);
	box-shadow: var(--shadow-sm);
}

/* Trophy / won button */
.btn-won {
	color: #d97706;
}
.btn-won:hover {
	color: #92400e;
	background: #fef3c7;
}
.btn-proposal {
	color: #3b82f6;
}
.btn-proposal:hover {
	color: #1d4ed8;
	background: #dbeafe;
}
.btn-contract {
	color: #8b5cf6;
}
.btn-contract:hover {
	color: #6d28d9;
	background: #ede9fe;
}
.btn-delete-opp {
	color: #94a3b8;
}
.btn-delete-opp:hover {
	color: #ef4444;
	background: #fee2e2;
}

/* Kanban board */
.kanban-board {
	display: flex;
	gap: 12px;
	padding: 16px 32px 0;
	overflow-x: auto;
	align-items: flex-start;
	height: calc(100vh - 70px);
	overflow-y: hidden;
}
.kanban-col {
	flex: 1 1 220px;
	min-width: 300px;
	max-width: 400px;
	background: #eeeeed;
	border-radius: 10px;
	border: 1px solid #d4d4d3;
	border-top-width: 3px;
	display: flex;
	flex-direction: column;
	max-height: calc(100vh - 86px);
}

.kanban-col-header {
	padding: 10px 12px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-bottom: 1px solid var(--color-border);
	flex-shrink: 0;
}
.kanban-col-title {
	font-size: 18px;
	font-weight: 600;
	color: var(--color-muted);
}
.kanban-col-count {
	font-size: 11px;
	font-weight: 600;
	color: #64748b;
	background: rgba(0, 0, 0, 0.07);
	padding: 1px 6px;
	border-radius: 10px;
}
.kanban-col-body {
	padding: 8px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-height: 80px;
	overflow-y: auto;
	flex: 1;
}
.kanban-empty {
	font-size: 12px;
	color: var(--color-border-strong);
	text-align: center;
	padding: 20px 8px;
	font-style: italic;
}

/* Kanban card */
.kanban-card {
	display: block;
	text-decoration: none;
	color: inherit;
	background: white;
	border: 1px solid #d4d4d3;
	border-radius: 6px;
	padding: 10px 12px;
	box-shadow: var(--shadow-sm);
	cursor: pointer;
	transition:
		box-shadow 0.12s,
		border-color 0.12s;
}
.kanban-card:hover {
	box-shadow: var(--shadow-sm);
	border-color: #94a3b8;
}
.kanban-card-name {
	font-size: 12px;
	font-weight: 500;
	color: var(--color-muted);
	margin-bottom: 2px;
}
.kanban-card-svc {
	font-size: 13px;
	font-weight: 600;
	color: var(--color-text);
	margin-bottom: 6px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.kanban-card-value {
	font-size: 12px;
	font-weight: 600;
	color: #059669;
	margin-bottom: 8px;
}
.kanban-card-won-btn {
	width: 100%;
	padding: 5px;
	border: 1px solid #d1fae5;
	border-radius: 6px;
	background: #f0fdf4;
	color: #059669;
	font-size: 12px;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.12s;
}
.kanban-card-won-btn:hover {
	background: #d1fae5;
}
.kanban-card.kc-dragging {
	opacity: 0.45;
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
	transform: rotate(1.5deg);
}
.kanban-col-body.kc-drop-target {
	background: #f0f9ff;
	outline: 2px dashed var(--color-primary);
	outline-offset: -4px;
	border-radius: 6px;
}

/* Toast */
.crm-toast {
	position: fixed;
	bottom: 32px;
	left: 50%;
	transform: translateX(-50%) translateY(16px);
	background: #1e293b;
	color: white;
	padding: 12px 20px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 500;
	z-index: 600;
	opacity: 0;
	transition:
		opacity 0.2s,
		transform 0.2s;
	pointer-events: none;
	white-space: nowrap;
}
.crm-toast.visible {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

/* ── CASES ── */

.badge-case-active {
	background: #f1f5f9;
	color: #475569;
	border-radius: 6px;
	padding: 2px 8px;
	font-size: 12px;
	font-weight: 500;
}
.badge-case-submitted {
	background: #fff7ed;
	color: #c2410c;
	border-radius: 6px;
	padding: 2px 8px;
	font-size: 12px;
	font-weight: 500;
}
.badge-case-complete {
	background: #f0fdf4;
	color: var(--color-success);
	border-radius: 6px;
	padding: 2px 8px;
	font-size: 12px;
	font-weight: 500;
}

.badge-urgency-urgent {
	background: #fff7ed;
	color: #c2410c;
	border-radius: 6px;
	padding: 2px 8px;
	font-size: 11px;
	font-weight: 600;
}
.badge-urgency-critical {
	background: #fef2f2;
	color: #dc2626;
	border-radius: 6px;
	padding: 2px 8px;
	font-size: 11px;
	font-weight: 600;
}

/* Filter dropdown */
.filter-dropdown-wrap {
	position: relative;
}
.filter-dropdown {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	background: white;
	border: 1px solid var(--color-border);
	border-radius: 8px;
	box-shadow: var(--shadow-md);
	padding: 4px;
	min-width: 140px;
	z-index: 50;
}
.fdd-item {
	display: block;
	width: 100%;
	text-align: left;
	padding: 7px 12px;
	border: none;
	background: none;
	border-radius: 6px;
	font-size: 13px;
	color: var(--color-text);
	cursor: pointer;
	transition: background 0.1s;
}
.fdd-item:hover {
	background: #f1f5f9;
}
.fdd-item.active {
	color: var(--color-primary);
	font-weight: 600;
	background: #eff6ff;
}
.filter-dd-label {
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #94a3b8;
	padding: 6px 10px 4px;
}
.filter-dd-option {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 7px 10px;
	font-size: 13px;
	color: var(--color-text);
	border-radius: 6px;
	cursor: pointer;
	transition: background 0.1s;
}
.filter-dd-option:hover {
	background: #f1f5f9;
}
.filter-dd-option input[type="radio"] {
	accent-color: var(--color-primary);
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}
.filter-dd-option input[type="radio"]:focus-visible {
	outline: 2px solid var(--color-primary);
	outline-offset: 2px;
}
#btn-filters.btn-filters--active,
.btn-filter.btn-filters--active {
	background: #eff6ff;
	border-color: var(--color-primary);
	color: var(--color-primary);
}

/* Urgency border on kanban cards */
.kanban-card.kc-urgent {
	border-color: #f59e0b;
}
.kanban-card.kc-critical {
	border-color: #ef4444;
}

/* Drive button inside kanban card */
.kanban-drive-btn {
	display: inline-block;
	margin-top: 6px;
	font-size: 11px;
	font-weight: 500;
	color: #3b82f6;
	text-decoration: none;
}
.kanban-drive-btn:hover {
	text-decoration: underline;
}

/* Capsule-style kanban card internals */
.kc-person {
	font-size: 11px;
	font-weight: 500;
	color: #94a3b8;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	margin-bottom: 3px;
}
.kc-title {
	font-size: 13px;
	font-weight: 600;
	color: #0f172a;
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin-bottom: 4px;
}
.kc-footer {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 4px;
}
.kc-value {
	font-size: 11px;
	font-weight: 600;
	color: #059669;
}
.kc-clock {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	font-size: 10px;
	color: var(--color-muted);
	margin-left: auto;
}
.kc-drive {
	display: inline-flex;
	align-items: center;
	color: var(--color-border-strong);
	text-decoration: none;
	border-radius: 4px;
	padding: 2px;
	margin-left: auto;
	transition: color 0.12s;
}
.kc-drive:hover {
	color: #3b82f6;
}
/* Opp kanban badges */
.kc-visa-warn {
	font-size: 10px;
	font-weight: 600;
	color: #d97706;
	margin-left: auto;
}

.kc-age-warn {
	font-size: 10px;
	font-weight: 700;
	color: #dc2626;
	background: #fee2e2;
	padding: 1px 5px;
	border-radius: 4px;
	margin-left: 2px;
}
.kc-no-contact {
	font-size: 10px;
	color: var(--color-muted);
	margin-left: auto;
}
.kc-payment-warn {
	font-size: 10px;
	font-weight: 600;
	color: #d97706;
	margin-left: auto;
}
.kc-payment-overdue {
	font-size: 10px;
	font-weight: 600;
	color: #dc2626;
	margin-left: auto;
}
/* Source row in people QV — low visual hierarchy */
.qv-source-row .qv-contact-row {
	opacity: 0.65;
}

/* Case progress bar — kanban card (no label) and QV (with label) */
.case-progress-bar {
	height: 3px;
	background: var(--color-border);
	border-radius: 2px;
	margin-top: 8px;
	overflow: hidden;
	position: relative;
}
.case-progress-bar--labeled {
	height: 6px;
	border-radius: 4px;
	flex: 1;
	margin-top: 0;
	display: flex;
	align-items: center;
	gap: 8px;
	background: transparent;
	overflow: visible;
}
.case-progress-bar--labeled .case-progress-fill {
	height: 6px;
	border-radius: 4px;
	flex-shrink: 0;
}
.case-progress-fill {
	height: 100%;
	background: var(--color-primary);
	border-radius: 2px;
	transition: width 0.3s ease;
}
.case-progress-label {
	font-size: 11px;
	font-weight: 600;
	color: var(--color-primary);
	white-space: nowrap;
}
/* QV progress row: stretch fill across content area */
.qv-progress-row .qv-cr-content {
	display: flex;
	align-items: center;
	gap: 8px;
}
.qv-progress-row .case-progress-bar--labeled {
	flex: 1;
	background: var(--color-border);
	overflow: hidden;
	display: block;
}
.qv-progress-row .case-progress-bar--labeled .case-progress-fill {
	display: block;
	height: 6px;
}
.qv-progress-row .case-progress-label {
	flex-shrink: 0;
}

/* ── SKELETON LOADER ── */
@keyframes skeleton-shimmer {
	0% {
		background-position: 200% 0;
	}
	100% {
		background-position: -200% 0;
	}
}
.skeleton-cell {
	display: inline-block;
	height: 13px;
	border-radius: 4px;
	background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
	background-size: 200% 100%;
	animation: skeleton-shimmer 1.2s ease-in-out infinite;
}
.skeleton-row td {
	vertical-align: middle;
	padding: 10px 12px !important;
}
.skeleton-row .td-name {
	display: flex;
	align-items: center;
	gap: 10px;
}

/* ── UNDO TOAST ── */
#undo-toast {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%);
	background: #1e293b;
	color: white;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px 18px;
	min-width: 280px;
	z-index: 600;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.15s;
}
#undo-toast.visible {
	opacity: 1;
	pointer-events: all;
}
.undo-msg {
	font-size: 13px;
	flex: 1;
}
.undo-btn {
	background: rgba(255, 255, 255, 0.15);
	border: none;
	color: white;
	border-radius: 6px;
	padding: 4px 12px;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.12s;
	white-space: nowrap;
}
.undo-btn:hover {
	background: rgba(255, 255, 255, 0.28);
}
.undo-progress {
	position: absolute;
	bottom: 0;
	left: 0;
	height: 3px;
	width: 100%;
	background: rgba(255, 255, 255, 0.35);
}

/* ── TOAST ── */
#crm-toast {
	position: fixed;
	bottom: 24px;
	right: 24px;
	background: #1e293b;
	color: white;
	font-size: 13px;
	font-weight: 500;
	padding: 8px 16px;
	border-radius: 8px;
	z-index: 600;
	opacity: 0;
	pointer-events: none;
	transform: translateY(6px);
	transition:
		opacity 0.15s,
		transform 0.15s;
}
#crm-toast.visible {
	opacity: 1;
	transform: translateY(0);
}

/* ── Copy cells in list ── */
.copy-cell {
	cursor: pointer;
}
.copy-cell:hover {
	opacity: 0.75;
}

/* ── Fade-in view transition ── */
#view-container {
	transition: opacity 0.1s ease;
}

/* ── Responsive: tables + layout below 1200px ── */
@media (max-width: 1200px) {
	.search-input-bar {
		width: 220px;
	}

	/* Table: reduzir padding horizontal das células */
	.data-table th {
		padding: 10px 10px;
	}
	.data-table td {
		padding: 14px 10px;
	}

	/* Checkbox column: ajustar padding */
	.th-check,
	.td-check {
		padding: 0 0 0 10px !important;
	}

	/* Ações: coluna menor */
	.th-actions,
	.td-actions {
		width: 110px;
	}

	/* Caso ativo: limitar largura para não dominar a linha */
	.td-active-case {
		max-width: 140px;
	}

	/* Sidebar: ligeiramente mais estreita */
	:root {
		--sidebar-w: 190px;
	}
}
@media (max-width: 1000px) {
	.search-input-bar {
		width: 90px;
		cursor: pointer;
	}
	.search-input-bar:focus {
		width: 180px;
		cursor: text;
	}
}

/* ── BELL + NOTIFICATIONS ── */
.bell-btn {
	position: relative;
	background: none;
	border: none;
	cursor: pointer;
	width: 100%;
	text-align: left;
}
.bell-badge {
	margin-left: auto;
	background: #ef4444;
	color: white;
	font-size: 10px;
	font-weight: 700;
	border-radius: 10px;
	padding: 1px 5px;
	min-width: 16px;
	text-align: center;
	line-height: 14px;
}
.sidebar.collapsed .bell-badge {
	position: absolute;
	top: 6px;
	right: 6px;
	margin-left: 0;
}

/* Notification slide-in panel — same pattern as .qv-panel */
.notif-backdrop {
	position: fixed;
	inset: 0;
	z-index: 210;
	pointer-events: none;
	background: transparent;
	transition: background 0.2s;
}
.notif-backdrop.notif-open {
	pointer-events: all;
	background: rgba(0, 0, 0, 0.22);
}
.notif-panel {
	position: fixed;
	top: 0;
	right: 0;
	height: 100vh;
	width: 340px;
	max-width: 95vw;
	background: white;
	border-left: 1px solid var(--color-border);
	box-shadow: -8px 0 40px rgba(0, 0, 0, 0.12);
	transform: translateX(100%);
	transition: transform 0.22s ease;
	z-index: 211;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}
.notif-panel.notif-open {
	transform: translateX(0);
}
.notif-panel-header {
	padding: 14px 20px;
	border-bottom: 1px solid var(--color-border);
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
}
.notif-panel-title {
	font-size: 14px;
	font-weight: 700;
	color: var(--color-text);
}
.notif-panel-actions {
	display: flex;
	align-items: center;
	gap: 12px;
}
.notif-close-btn {
	background: none;
	border: none;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	color: var(--color-muted);
	padding: 0 2px;
}
.notif-close-btn:hover {
	color: var(--color-text);
}
.notif-clear-btn {
	background: none;
	border: none;
	font-size: 12px;
	color: var(--color-primary);
	cursor: pointer;
	padding: 0;
	font-weight: 500;
}
.notif-clear-btn:hover {
	text-decoration: underline;
}
.notif-list {
	overflow-y: auto;
	flex: 1;
}
.notif-item {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 10px 16px;
	cursor: pointer;
	transition: background 0.1s;
	border-bottom: 1px solid var(--color-border);
}
.notif-item:last-child {
	border-bottom: none;
}
.notif-item:hover {
	background: #f8fafc;
}
.notif-item.notif-unread {
	background: #f0f7ff;
}
.notif-item.notif-unread:hover {
	background: #e0f0ff;
}
.notif-dot-wrap {
	width: 8px;
	display: flex;
	align-items: center;
	padding-top: 5px;
	flex-shrink: 0;
}
.notif-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #3b82f6;
}
.notif-avatar {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 10px;
	font-weight: 700;
	color: white;
	flex-shrink: 0;
}
.notif-body {
	flex: 1;
	min-width: 0;
}
.notif-title {
	font-size: 13px;
	color: var(--color-text);
	line-height: 1.4;
	margin-bottom: 2px;
}
.notif-preview {
	font-size: 12px;
	color: var(--color-muted);
	line-height: 1.4;
	margin-bottom: 2px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.notif-time {
	font-size: 11px;
	color: var(--color-muted);
}
.notif-loading,
.notif-empty {
	font-size: 12px;
	color: var(--color-muted);
	padding: 16px;
	text-align: center;
}

/* ── @MENTION ── */
.mention {
	color: #3b82f6;
	font-weight: 600;
	background: #eff6ff;
	border-radius: 4px;
	padding: 0 2px;
}
.mention-dropdown {
	position: absolute;
	background: white;
	border: 1px solid var(--color-border);
	border-radius: 8px;
	box-shadow: var(--shadow-lg);
	z-index: 700;
	overflow: hidden;
	max-height: 180px;
	overflow-y: auto;
}
.mention-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 7px 12px;
	font-size: 13px;
	cursor: pointer;
	transition: background 0.1s;
}
.mention-item:hover,
.mention-item-active {
	background: #f1f5f9;
}
.mention-avatar {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 9px;
	font-weight: 700;
	color: white;
	flex-shrink: 0;
}

/* ── NOTES ── */
.notes-section {
	padding-top: 4px;
}
.notes-form {
	margin-bottom: 12px;
}
.notes-textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 8px 10px;
	font-size: 13px;
	font-family: inherit;
	line-height: 1.5;
	border: 1.5px solid var(--color-border);
	border-radius: 8px;
	resize: none;
	overflow: hidden;
	min-height: 68px;
	transition: border-color 0.15s;
	color: var(--color-text);
	background: var(--color-bg);
}
.notes-textarea:focus {
	outline: none;
	border-color: var(--color-primary);
}
.notes-form-footer {
	display: flex;
	justify-content: flex-end;
	margin-top: 6px;
}
.notes-save-btn {
	min-width: 68px;
}
.notes-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.notes-loading,
.notes-empty {
	font-size: 12px;
	color: var(--color-muted);
	padding: 4px 0 8px;
}
.note-item {
	border: 1px solid var(--color-border);
	border-radius: 8px;
	padding: 10px 12px;
	background: var(--color-bg);
}
.note-header {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 7px;
}
.note-avatar {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 8px;
	font-weight: 700;
	color: white;
	flex-shrink: 0;
}
.note-author {
	font-size: 12px;
	font-weight: 600;
	color: var(--color-text);
	flex: 1;
}
.note-time {
	font-size: 11px;
	color: var(--color-muted);
}
.note-delete-btn {
	background: none;
	border: none;
	cursor: pointer;
	color: var(--color-muted);
	padding: 2px;
	border-radius: 4px;
	display: flex;
	align-items: center;
	opacity: 0;
	transition:
		opacity 0.12s,
		color 0.12s;
}
.note-item:hover .note-delete-btn {
	opacity: 1;
}
.note-delete-btn:hover {
	color: #ef4444;
}
.note-content {
	font-size: 13px;
	font-weight: 400;
	line-height: 1.55;
	color: var(--color-text);
	white-space: pre-wrap;
	word-break: break-word;
}

/* ── TASKS ── */

/* Toolbar */
.tasks-page-header {
	grid-template-columns: auto 1fr auto;
}
.tasks-tabs {
	display: flex;
	align-items: center;
	gap: 2px;
	background: #f1f5f9;
	border-radius: 8px;
	padding: 3px;
	width: fit-content;
	justify-self: center;
}
.tasks-tab {
	background: none;
	border: none;
	border-radius: 6px;
	padding: 5px 16px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	color: #64748b;
	font-family: inherit;
	transition:
		background 0.1s,
		color 0.1s,
		box-shadow 0.1s;
	white-space: nowrap;
}
.tasks-tab.active {
	background: white;
	color: #111827;
	font-weight: 600;
	box-shadow: var(--shadow-sm);
}
.tasks-tab:not(.active):hover {
	color: #1e293b;
	background: rgba(255, 255, 255, 0.5);
}

.tasks-content {
	padding: 8px 24px 40px;
}

/* Groups */
.task-group {
	margin-bottom: 8px;
}
.task-group-header {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 14px 6px 6px;
}
.task-group-label {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}
.task-group-header--overdue .task-group-label {
	color: #ef4444;
}
.task-group-header--today .task-group-label {
	color: var(--color-success);
}
.task-group-header--done .task-group-label {
	color: var(--color-success);
}
.task-group-header--neutral .task-group-label {
	color: #6b7280;
}
.task-group-count {
	font-size: 11px;
	color: #94a3b8;
	background: #f1f5f9;
	border-radius: 10px;
	padding: 1px 7px;
	font-weight: 500;
}

/* Task row — two-line layout */
.task-row {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 10px;
	min-height: 52px;
	border-radius: 8px;
	cursor: pointer;
	border: 1px solid transparent;
	transition:
		background 0.1s,
		border-color 0.1s;
}
.task-row:hover {
	background: #f8fafc;
	border-color: var(--color-border);
}
.task-row-overdue {
	background: #fff7f7;
}
.task-row-overdue:hover {
	background: #fef2f2;
}
.task-done .task-row__title {
	text-decoration: line-through;
	color: #94a3b8;
}
.task-done {
	opacity: 0.5;
}

/* Checkbox */
.task-check-btn {
	background: none;
	border: none;
	cursor: pointer;
	padding: 2px;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}
.task-check-circle {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 2px solid var(--color-border-strong);
	transition: border-color 0.12s;
}
.task-check-btn:hover .task-check-circle {
	border-color: var(--color-success);
}

/* Row body (two lines) */
.task-row__body {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.task-row__line1 {
	display: flex;
	align-items: center;
	gap: 6px;
}
.task-row__title {
	font-size: 14px;
	font-weight: 600;
	color: #111827;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.task-row__line2 {
	display: flex;
	align-items: center;
	gap: 4px;
}
.task-row__meta-arrow {
	font-size: 11px;
	color: var(--color-border-strong);
}
.task-row__meta-person {
	font-size: 12px;
	color: #9ca3af;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Right-side: avatar + due chip + detail btn */
.task-row__right {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}
.task-row__meta-right {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 1px;
}
.task-assignee-avatar {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	color: white;
	font-size: 10px;
	font-weight: 600;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	cursor: default;
}
.task-row__created {
	font-size: 11px;
	color: var(--color-border-strong);
	white-space: nowrap;
}
.task-row__due {
	font-size: 11px;
	font-weight: 500;
	border-radius: 4px;
	padding: 2px 7px;
	white-space: nowrap;
}
.task-row__due--overdue {
	color: #ef4444;
	background: #fef2f2;
}
.task-row__due--today {
	color: #059669;
	background: #d1fae5;
}
.task-row__due--future {
	color: #64748b;
	background: #f1f5f9;
}

/* Inline expand */
.task-expand {
	padding: 8px 14px 14px 42px;
	border-bottom: 1px solid var(--color-border);
}

/* Expand action bar */
.task-exp-actions {
	display: flex;
	align-items: center;
	gap: 4px;
	margin-bottom: 10px;
	padding-bottom: 8px;
	border-bottom: 1px solid #f1f5f9;
}
.task-exp-btn {
	display: flex;
	align-items: center;
	gap: 5px;
	background: none;
	border: 1px solid var(--color-border);
	border-radius: 6px;
	padding: 4px 10px;
	font-size: 12px;
	color: #64748b;
	cursor: pointer;
	transition:
		background 0.1s,
		color 0.1s;
}
.task-exp-btn:hover {
	background: #f1f5f9;
	color: #111827;
}
.task-exp-delete:hover {
	background: #fef2f2;
	color: #ef4444;
	border-color: #fca5a5;
}
.task-exp-comment-label {
	display: flex;
	align-items: center;
	gap: 5px;
	font-size: 12px;
	color: #94a3b8;
	margin-left: auto;
}
.task-expand-desc {
	font-size: 13px;
	color: #475569;
	margin-bottom: 10px;
	white-space: pre-wrap;
}

/* Comments */
.tc-list {
	margin-bottom: 10px;
}
.tc-item {
	display: flex;
	gap: 8px;
	margin-bottom: 8px;
	align-items: flex-start;
}
.tc-avatar {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	color: white;
	font-size: 10px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.tc-bubble {
	background: #f8fafc;
	border: 1px solid var(--color-border);
	border-radius: 8px;
	padding: 7px 11px;
	flex: 1;
}
.tc-author {
	font-size: 11px;
	font-weight: 600;
	color: #475569;
	display: block;
	margin-bottom: 2px;
}
.tc-content {
	font-size: 13px;
	color: var(--color-text);
	white-space: pre-wrap;
}
.tc-empty {
	font-size: 12px;
	color: #94a3b8;
	padding: 2px 0 8px;
}
.tc-form {
	display: flex;
	gap: 8px;
	align-items: flex-end;
}
.tc-input {
	flex: 1;
	padding: 7px 10px;
	border: 1.5px solid var(--color-border);
	border-radius: 8px;
	font-size: 13px;
	font-family: inherit;
	resize: none;
}
.tc-input:focus {
	outline: none;
	border-color: var(--color-primary);
}

/* Task expand comments */
.task-exp-comments {
	padding: 8px 12px 12px;
	border-top: 1px solid var(--color-border);
}
.task-exp-comments-list {
	margin-bottom: 8px;
}
.task-comment-item {
	margin-bottom: 8px;
}
.task-comment-author {
	font-size: 11px;
	font-weight: 600;
	color: #475569;
}
.task-comment-time {
	font-size: 11px;
	color: #94a3b8;
	margin-left: 6px;
}
.task-comment-body {
	font-size: 13px;
	color: var(--color-text);
	margin: 2px 0 0;
	white-space: pre-wrap;
}
.task-comments-loading,
.task-comments-empty {
	font-size: 12px;
	color: #94a3b8;
}
.task-exp-comment-form {
	display: flex;
	gap: 6px;
}
.task-comment-input {
	flex: 1;
	padding: 6px 10px;
	border: 1.5px solid var(--color-border);
	border-radius: 6px;
	font-size: 13px;
	font-family: inherit;
}
.task-comment-input:focus {
	outline: none;
	border-color: var(--color-primary);
}
.task-comment-send {
	padding: 6px 12px;
	background: var(--color-primary);
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
}
.task-comment-send:hover {
	background: var(--color-primary-h);
}

/* QV tasks section */
.tasks-qv-section {
	border-top: 1px solid var(--color-border);
	padding-top: 16px;
}
.qv-tasks-list {
	display: flex;
	flex-direction: column;
}
.tasks-qv-empty {
	font-size: 13px;
	color: #94a3b8;
	padding: 6px 0;
}
.qv-done-section {
	margin-top: 6px;
	border-top: 1px solid #f1f5f9;
	padding-top: 4px;
}
.qv-done-toggle {
	background: none;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 5px;
	font-size: 11px;
	font-weight: 600;
	color: #94a3b8;
	padding: 4px 2px;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}
.qv-done-toggle svg {
	transition: transform 0.15s;
}
.qv-done-toggle[data-open="true"] svg {
	transform: rotate(90deg);
}
.qv-done-list {
	display: flex;
	flex-direction: column;
}

/* Empty/loading states */
.tasks-loading {
	display: flex;
	justify-content: center;
	padding: 40px;
}
.tasks-empty {
	text-align: center;
	color: #94a3b8;
	padding: 48px 0;
	font-size: 14px;
}

/* Person search dropdown in modal */
.ps-dropdown {
	background: white;
	border: 1px solid var(--color-border);
	border-radius: 8px;
	overflow: hidden;
	margin-top: 4px;
	max-height: 200px;
	overflow-y: auto;
	box-shadow: var(--shadow-md);
}
.ps-email {
	font-size: 11px;
	color: #94a3b8;
	margin-left: 8px;
}

/* ============================================================
   Phase 7 — Dashboard v2 + Relatorio de Produtividade
   ============================================================ */

/* ── Dashboard v2 Layout ── */
.dashboard-v2 {
	display: flex;
	flex-direction: column;
	gap: 24px;
	padding: 0 0 32px;
}

.dash-section {
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	padding: 20px 24px;
}

.dash-section-title {
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--color-muted);
	margin-bottom: 16px;
}

.dash-sections-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 24px;
}

.dash-loading {
	color: var(--color-muted);
	font-size: 13px;
	padding: 8px 0;
}

.dash-empty {
	color: var(--color-muted);
	font-size: 13px;
	padding: 8px 0;
}

.dash-error {
	color: var(--color-danger);
	font-size: 13px;
	padding: 8px 0;
}

/* ── Banner ── */
.dash-banner {
	display: flex;
	align-items: center;
	gap: 12px;
	background: #eff6ff;
	border: 1px solid #bfdbfe;
	border-radius: var(--radius);
	padding: 12px 16px;
	font-size: 14px;
	color: #1e40af;
}

.dash-banner-text {
	flex: 1;
	font-weight: 500;
}

.dash-banner-close {
	background: none;
	border: none;
	font-size: 18px;
	line-height: 1;
	color: #93c5fd;
	cursor: pointer;
	padding: 0 4px;
	border-radius: 4px;
	transition: color 0.1s;
}

.dash-banner-close:hover {
	color: #1e40af;
}

/* ── Pipeline ── */
.pipeline-row {
	display: flex;
	align-items: center;
	gap: 16px;
}

.pipe-card {
	flex: 1;
	border-radius: var(--radius);
	padding: 20px 24px;
	border: 1px solid transparent;
}

.pipe-card-blue {
	background: #eff6ff;
	border-color: #bfdbfe;
}
.pipe-card-orange {
	background: #fff7ed;
	border-color: #fed7aa;
}
.pipe-card-green {
	background: #f0fdf4;
	border-color: #bbf7d0;
}

.pipe-card-number {
	font-size: 36px;
	font-weight: 700;
	line-height: 1;
	margin-bottom: 4px;
}

.pipe-card-blue .pipe-card-number {
	color: #1d4ed8;
}
.pipe-card-orange .pipe-card-number {
	color: #c2410c;
}
.pipe-card-green .pipe-card-number {
	color: #15803d;
}

.pipe-card-label {
	font-size: 14px;
	font-weight: 600;
	color: var(--color-text);
	margin-bottom: 2px;
}

.pipe-card-sub {
	font-size: 12px;
	color: var(--color-muted);
}

.pipe-arrow {
	font-size: 20px;
	color: var(--color-muted);
	flex-shrink: 0;
}

/* ── Urgent Cases List ── */
.urgent-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* My tasks widget */
.my-task-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 8px 12px;
	border-radius: 6px;
	background: #fafafa;
	border: 1px solid var(--color-border);
	cursor: pointer;
	transition: background 0.12s;
}
.my-task-row + .my-task-row { margin-top: 6px; }
.my-task-row:hover { background: var(--color-primary-light); }
.my-task-body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}
.my-task-title {
	font-size: 13px;
	font-weight: 500;
	color: var(--color-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.my-task-entity {
	font-size: 11px;
	color: var(--color-muted);
}
.my-task-due {
	font-size: 12px;
	color: var(--color-muted);
	white-space: nowrap;
	flex-shrink: 0;
}
.my-task-overdue {
	color: #ef4444;
	font-weight: 600;
}
.my-task-footer {
	margin-top: 8px;
	text-align: right;
}
.my-task-footer a {
	font-size: 12px;
	color: var(--color-primary);
	text-decoration: none;
}
.my-task-footer a:hover { text-decoration: underline; }

.urgent-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 8px 12px;
	border-radius: 6px;
	background: #fafafa;
	border: 1px solid var(--color-border);
}
.urgent-row:hover { background: #fff3f3; }

.urgent-row-left {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.urgent-row-right {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

.urgent-person {
	font-size: 13px;
	font-weight: 500;
	color: var(--color-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.urgent-stage {
	font-size: 12px;
	color: var(--color-muted);
	white-space: nowrap;
}

.urgency-badge {
	font-size: 10px;
	font-weight: 700;
	border-radius: 4px;
	padding: 2px 7px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	flex-shrink: 0;
}

.urgency-badge-critical {
	background: #fef2f2;
	color: #dc2626;
	border: 1px solid #fecaca;
}

.urgency-badge-urgent {
	background: #fff7ed;
	color: #d97706;
	border: 1px solid #fed7aa;
}

.urgency-badge-normal {
	background: #f1f5f9;
	color: var(--color-muted);
	border: 1px solid var(--color-border);
}

.assignee-chip {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	color: white;
	font-size: 10px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

/* ── Submissions List ── */
.sub-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.sub-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 8px 12px;
	border-radius: 6px;
	background: #fafafa;
	border: 1px solid var(--color-border);
}

.sub-row-left {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.sub-person {
	font-size: 13px;
	font-weight: 500;
	color: var(--color-text);
}

.sub-stage {
	font-size: 11px;
	color: var(--color-muted);
}

.sub-date {
	font-size: 12px;
	font-weight: 600;
	color: var(--color-primary);
	flex-shrink: 0;
}

/* ── Team Table ── */
.team-table {
	width: 100%;
	border-collapse: collapse;
}

.team-th {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--color-muted);
	text-align: left;
	padding: 6px 12px 8px;
	border-bottom: 1px solid var(--color-border);
}

.team-th-num {
	text-align: center;
}

.team-row {
	border-bottom: 1px solid var(--color-border);
	transition: background 0.1s;
}

.team-row:last-child {
	border-bottom: none;
}

.team-row:hover {
	background: #f8fafc;
}

.team-name-cell {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
}

.team-avatar {
	border-radius: 50%;
	color: white;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.team-name-text {
	font-size: 13px;
	font-weight: 500;
}

.team-num {
	text-align: center;
	padding: 10px 12px;
	font-size: 14px;
	font-weight: 600;
}

.team-num-overdue {
	color: var(--color-danger);
}

.team-avg {
	text-align: center;
	padding: 10px 12px;
	font-size: 13px;
	color: var(--color-muted);
}

/* ── Reports View ── */
.reports-view {
	display: flex;
	flex-direction: column;
	gap: 24px;
	padding-bottom: 32px;
}

.report-filters {
	display: flex;
	align-items: flex-end;
	gap: 24px;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	padding: 16px 20px;
}

.report-filter-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.report-filter-label {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--color-muted);
}

.btn-group {
	display: flex;
	gap: 0;
}

.btn-group .btn {
	border-radius: 0;
	border-right-width: 0;
}

.btn-group .btn:first-child {
	border-radius: var(--radius) 0 0 var(--radius);
}

.btn-group .btn:last-child {
	border-radius: 0 var(--radius) var(--radius) 0;
	border-right-width: 1px;
}

.report-period-btn.active {
	background: var(--color-primary);
	color: white;
	border-color: var(--color-primary);
}

.report-select {
	padding: 6px 10px;
	border: 1.5px solid var(--color-border);
	border-radius: var(--radius);
	font-size: 13px;
	background: white;
	color: var(--color-text);
	min-width: 160px;
}

.report-select:focus {
	outline: none;
	border-color: var(--color-primary);
}

.report-consultant-block {
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	padding: 20px 24px;
	margin-bottom: 16px;
}

.report-consultant-header {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 16px;
}

.report-consultant-name {
	font-size: 15px;
	font-weight: 600;
}

.report-summary-grid {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.report-summary-grid-inner {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 12px;
}

.report-card {
	background: var(--color-bg);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	padding: 16px 20px;
}

.report-card-number {
	font-size: 28px;
	font-weight: 700;
	color: var(--color-primary);
	margin-bottom: 4px;
}

.report-card-label {
	font-size: 12px;
	color: var(--color-muted);
}

/* ── Report Table ── */
.report-table {
	width: 100%;
	border-collapse: collapse;
}

.rt-th {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--color-muted);
	text-align: left;
	padding: 8px 12px;
	border-bottom: 1px solid var(--color-border);
	background: #f8fafc;
}

.rt-cell {
	padding: 10px 12px;
	font-size: 13px;
	border-bottom: 1px solid var(--color-border);
	vertical-align: middle;
}

.rt-date {
	color: var(--color-muted);
	white-space: nowrap;
}

.report-table tbody tr:last-child .rt-cell {
	border-bottom: none;
}

.report-table tbody tr:hover {
	background: #f8fafc;
}

/* ── Task Status Badges ── */
.task-status-badge {
	font-size: 10px;
	font-weight: 700;
	border-radius: 4px;
	padding: 2px 8px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	white-space: nowrap;
}

.badge-done {
	background: #f0fdf4;
	color: #15803d;
	border: 1px solid #bbf7d0;
}

.badge-ongoing {
	background: #f1f5f9;
	color: var(--color-muted);
	border: 1px solid var(--color-border);
}

.badge-overdue {
	background: #fef2f2;
	color: #dc2626;
	border: 1px solid #fecaca;
}

/* Entity type label in report table */
.entity-type-label {
	font-size: 12px;
	color: var(--color-muted);
	font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
	.pipeline-row {
		flex-direction: column;
	}
	.pipe-arrow {
		transform: rotate(90deg);
	}
	.dash-sections-row {
		grid-template-columns: 1fr;
	}
	.report-summary-grid-inner {
		grid-template-columns: repeat(2, 1fr);
	}
	.report-filters {
		flex-direction: column;
		align-items: flex-start;
	}
}

/* ============================================================
   INVOICES — Phase 8
   ============================================================ */

/* ── Contract/Invoice pre-flight modal ── */
.ci-info-block {
	padding: 10px 14px;
	background: var(--color-bg-subtle, #f8fafc);
	border-radius: 8px;
	border: 1px solid var(--color-border);
}
.ci-check-row {
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	font-size: 13px;
	padding: 6px 0;
}
.ci-check-row input[type="checkbox"] {
	width: 16px;
	height: 16px;
	accent-color: var(--color-primary);
	cursor: pointer;
	flex-shrink: 0;
}

/* Page layout */
.inv-page {
	padding: 0;
	height: 100%;
	display: flex;
	flex-direction: column;
}
.inv-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px 12px;
}
.inv-title {
	font-size: 20px;
	font-weight: 700;
	color: var(--color-text);
}
.inv-search-wrap {
	position: relative;
	display: flex;
	align-items: center;
}
.inv-search-icon {
	position: absolute;
	left: 10px;
	color: var(--color-muted);
	pointer-events: none;
}
.inv-search {
	padding: 7px 12px 7px 32px;
	border: 1.5px solid var(--color-border);
	border-radius: 8px;
	font-size: 13px;
	width: 260px;
	background: var(--color-bg-input);
}
.inv-search:focus {
	outline: none;
	border-color: var(--color-primary);
}

/* Tabs */
.inv-tabs {
	display: flex;
	gap: 2px;
	padding: 0 24px 12px;
	border-bottom: 1px solid var(--color-border);
}
.inv-tab {
	padding: 6px 14px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 500;
	border: none;
	background: none;
	cursor: pointer;
	color: var(--color-muted);
	transition: all 0.12s;
}
.inv-tab:hover {
	background: var(--color-bg-hover);
	color: var(--color-text);
}
.inv-tab.active {
	background: var(--color-primary-subtle, #eff6ff);
	color: var(--color-primary);
	font-weight: 600;
}

/* Summary cards */
.inv-summary {
	display: flex;
	gap: 12px;
	padding: 14px 24px;
	border-bottom: 1px solid var(--color-border);
}
.inv-stat {
	flex: 1;
	background: var(--color-bg-card, white);
	border: 1px solid var(--color-border);
	border-radius: 8px;
	padding: 10px 14px;
}
.inv-stat-label {
	font-size: 11px;
	color: var(--color-muted);
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin-bottom: 4px;
}
.inv-stat-value {
	font-size: 18px;
	font-weight: 700;
	color: var(--color-text);
}
.inv-stat-green {
	color: var(--color-success);
}
.inv-stat-amber {
	color: #f59e0b;
}
.inv-stat-red {
	color: #ef4444;
}
.inv-stat-alert {
	border-color: #fca5a5;
	background: #fef2f2;
}

/* Table */
.inv-table-wrap {
	flex: 1;
	overflow-y: auto;
	padding: 0 24px 24px;
}
.inv-table {
	width: 100%;
	border-collapse: collapse;
}
.inv-table thead th {
	font-size: 11px;
	font-weight: 600;
	color: var(--color-muted);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 10px 12px;
	text-align: left;
	border-bottom: 1px solid var(--color-border);
	white-space: nowrap;
}
.inv-table .text-right {
	text-align: right;
}
.inv-row {
	border-bottom: 1px solid var(--color-border);
	cursor: pointer;
	transition: background 0.1s;
}
.inv-row:hover {
	background: var(--color-bg-hover, #f9fafb);
}
.inv-row td {
	padding: 11px 12px;
	font-size: 13px;
}
.inv-number {
	font-weight: 600;
	font-family: monospace;
	font-size: 12px;
	color: var(--color-text);
}
.inv-client {
	font-weight: 500;
}
.inv-case {
	color: var(--color-muted);
	font-size: 12px;
}
.inv-mono {
	font-family: monospace;
	font-size: 13px;
}
.inv-paid-col {
	color: var(--color-success);
}
.inv-balance-due {
	font-weight: 700;
	color: #f59e0b;
}
.inv-zero {
	color: var(--color-muted);
}
.inv-date-overdue {
	color: #ef4444;
	font-weight: 600;
}
.inv-loading,
.inv-empty,
.inv-error {
	text-align: center;
	padding: 32px;
	color: var(--color-muted);
	font-size: 13px;
}
.inv-error {
	color: #ef4444;
}

/* Status pill */
.inv-status-pill {
	display: inline-block;
	font-size: 11px;
	border-radius: 6px;
	padding: 2px 8px;
	white-space: nowrap;
}

/* Actions */
.inv-actions-cell {
	text-align: right;
}
.inv-view-btn {
	font-size: 11px;
	padding: 3px 10px;
	border: 1px solid var(--color-border);
	border-radius: 6px;
	background: white;
	cursor: pointer;
	color: var(--color-muted);
	transition: all 0.1s;
}
.inv-view-btn:hover {
	border-color: var(--color-primary);
	color: var(--color-primary);
}

/* Detail panel (reuses QV backdrop) */
.inv-detail-panel {
	position: fixed;
	right: 0;
	top: 0;
	bottom: 0;
	width: 480px;
	background: white;
	z-index: 250;
	box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform 0.25s ease;
	overflow: hidden;
}
.inv-detail-panel.qv-open {
	transform: translateX(0);
}
.inv-detail-loading,
.inv-detail-error {
	padding: 40px 24px;
	text-align: center;
	color: var(--color-muted);
	font-size: 13px;
}

/* Detail header */
.inv-detail-header {
	padding: 20px 20px 14px;
	border-bottom: 1px solid var(--color-border);
	flex-shrink: 0;
}
.inv-detail-header-top {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	margin-bottom: 12px;
}
.inv-detail-number {
	font-size: 18px;
	font-weight: 700;
	font-family: monospace;
}
.inv-detail-dates {
	font-size: 12px;
	color: var(--color-muted);
	margin-top: 3px;
}
.inv-detail-header-actions {
	display: flex;
	align-items: center;
	gap: 8px;
}
.inv-close-btn {
	background: none;
	border: none;
	font-size: 22px;
	cursor: pointer;
	color: var(--color-muted);
	line-height: 1;
	padding: 0 2px;
}
.inv-close-btn:hover {
	color: var(--color-text);
}
.inv-detail-meta {
	display: flex;
	gap: 20px;
}
.inv-meta-item {
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.inv-meta-label {
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--color-muted);
}
.inv-meta-val {
	font-size: 13px;
	font-weight: 500;
}
.text-amber-bold {
	color: #f59e0b;
	font-weight: 700;
}
.text-green {
	color: var(--color-success);
	font-weight: 600;
}
.text-red {
	color: #ef4444;
}

/* Detail body */
.inv-detail-body {
	flex: 1;
	overflow-y: auto;
	padding: 16px 20px;
}

.inv-section {
	margin-bottom: 20px;
}
.inv-section-title {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--color-muted);
	margin-bottom: 10px;
}

/* Line items table */
.inv-items-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 12px;
}
.inv-items-table th {
	font-size: 10px;
	font-weight: 600;
	color: var(--color-muted);
	text-transform: uppercase;
	padding: 6px 8px;
	border-bottom: 1px solid var(--color-border);
	text-align: left;
}
.inv-items-table td {
	padding: 8px 8px;
	border-bottom: 1px solid #f3f4f6;
}
.inv-items-table .text-right {
	text-align: right;
}
.inv-items-table .text-center {
	text-align: center;
}
.item-label {
	font-weight: 500;
}
.item-desc {
	font-size: 11px;
	color: var(--color-muted);
	margin-top: 1px;
}
.gst-yes {
	color: var(--color-success);
	font-size: 10px;
	font-weight: 600;
}
.gst-no {
	color: var(--color-border-strong);
	font-size: 10px;
}

.inv-totals {
	padding: 8px 8px 0;
}
.inv-total-row {
	display: flex;
	justify-content: space-between;
	font-size: 12px;
	color: var(--color-muted);
	padding: 3px 0;
}
.inv-total-grand {
	font-size: 14px;
	font-weight: 700;
	color: var(--color-text);
	border-top: 1px solid var(--color-border);
	padding-top: 6px;
	margin-top: 4px;
}

/* Installment timeline */
.inv-timeline {
	display: flex;
	flex-direction: column;
	gap: 0;
}
.inv-timeline-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 0;
	border-bottom: 1px solid #f3f4f6;
}
.inv-timeline-item:last-child {
	border-bottom: none;
}
.inv-tl-dot {
	font-size: 18px;
	width: 20px;
	text-align: center;
	flex-shrink: 0;
	color: var(--color-border-strong);
	line-height: 1;
}
.inv-timeline-item.is-paid .inv-tl-dot {
	color: var(--color-success);
}
.inv-timeline-item.is-overdue .inv-tl-dot {
	color: #ef4444;
}
.inv-tl-info {
	flex: 1;
}
.inv-tl-label {
	font-size: 13px;
	font-weight: 500;
}
.inv-tl-meta {
	font-size: 11px;
	color: var(--color-muted);
	margin-top: 2px;
}
.inv-tl-paid {
	color: var(--color-success);
}
.inv-tl-action {
	flex-shrink: 0;
}
.inv-tl-check {
	font-size: 11px;
	color: var(--color-success);
	font-weight: 600;
}
.btn-sm {
	padding: 5px 08px;
	font-size: 12px;
	place-content: center;
}

/* ── Breadcrumb (Person Page + Case Page) ── */
.pp-breadcrumb {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: #94a3b8;
	padding: 0 0 10px;
}
.pp-breadcrumb a {
	color: #64748b;
	text-decoration: none;
}
.pp-breadcrumb a:hover {
	color: #1e293b;
	text-decoration: underline;
}
.pp-bc-sep {
	color: var(--color-border-strong);
}
.pp-bc-current {
	color: #374151;
	font-weight: 500;
}

/* ── Person Page v5 ────────────────────────────────────────── */
.pp-page-header {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 0 24px;
	background: white;
	height: 60px;
	flex-shrink: 0;
	position: relative;
	z-index: 20;
	border-bottom: 1px solid var(--color-border);
	box-shadow:
		0 1px 0 #e2e8f0,
		0 2px 8px rgba(0, 0, 0, 0.04);
}
.pp-page-header-left {
	flex: 1;
	min-width: 0;
}
.pp-page-header-crumb {
	font-size: 11px;
	color: #94a3b8;
	margin-bottom: 1px;
}
.pp-page-header-crumb a {
	color: #64748b;
	font-weight: 500;
	text-decoration: none;
}
.pp-page-header-crumb a:hover {
	color: #1a56db;
}
.pp-page-header-title {
	font-size: 25px;
	font-weight: 700;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.pp-page-header-right {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
}
.pp-body {
	flex: 1;
	display: flex;
	overflow: hidden;
	min-height: 0;
}
.pp-person-sidebar {
	width: 400px;
	flex-shrink: 0;
	background: white;
	border-left: 1px solid var(--color-border);
	border-right: none;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	padding: 20px;
}
.pps-name-block {
	padding: 16px 20px 14px;
	border-bottom: 1px solid var(--color-border);
	flex-shrink: 0;
}
.pps-name {
	font-size: 15px;
	font-weight: 700;
	color: #0f172a;
	line-height: 1.3;
}
.pps-type {
	font-size: 11px;
	color: #94a3b8;
	margin-top: 2px;
}
/* Flat sidebar fields (new layout) */
.ps-section {
	padding: 14px 20px 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	border-bottom: 1px solid #f1f5f9;
}
.ps-field {
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.ps-label {
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	color: #94a3b8;
}
.ps-value {
	font-size: 13px;
	color: #1e293b;
	line-height: 1.4;
	display: flex;
	align-items: center;
	gap: 4px;
	word-break: break-word;
}
.ps-value.copyable {
	cursor: pointer;
}
.ps-value.copyable:hover {
	color: #2563eb;
}
.ps-copy-icon {
	color: #c9d4e0;
	flex-shrink: 0;
}
.ps-value.copyable:hover .ps-copy-icon {
	color: #93c5fd;
}
.ps-value.ps-empty {
	color: #c9d4e0;
	font-style: italic;
}
.ps-age {
	color: #94a3b8;
	font-size: 11px;
	font-weight: 400;
}
.ps-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}
.ps-tag {
	font-size: 11px;
	font-weight: 500;
	color: #475569;
	background: #f1f5f9;
	border: 1px solid #e2e8f0;
	border-radius: 4px;
	padding: 1px 7px;
}
.ps-edit-btn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: #f8fafc;
	border: 1px solid var(--color-border-strong);
	color: #374151;
	font-size: 12px;
	font-weight: 500;
	padding: 6px 12px;
	border-radius: 6px;
	cursor: pointer;
	align-self: flex-start;
	margin-top: 2px;
}
.ps-edit-btn:hover {
	background: #f1f5f9;
	border-color: #94a3b8;
	color: #0f172a;
}
.ps-sobre-section {
	padding: 14px 20px 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* ── Case Page (CPD) ─────────────────────────────────────── */
/* Urgency line */
.cpd-urgency-line {
	height: 3px;
	flex-shrink: 0;
}
.cpd-urgency-critical {
	background: #ef4444;
}
.cpd-urgency-urgent {
	background: #f59e0b;
}
/* Header */
.cpd-page-title {
	font-size: 17px;
	font-weight: 700;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.cpd-breadcrumb {
	font-size: 11px;
	color: #94a3b8;
	margin-top: 2px;
}
.cpd-breadcrumb-link {
	color: #1a56db;
	font-weight: 500;
	text-decoration: none;
}
.cpd-breadcrumb-link:hover {
	text-decoration: underline;
}
/* Header action buttons */
.pp-action-btn {
	font-size: 12px;
	font-weight: 500;
	padding: 6px 12px;
	border-radius: 6px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	text-decoration: none;
}
/* PPD + Novo dropdown */
.pp-new-dropdown {
	position: relative;
	display: inline-flex;
}
.pp-new-menu {
	display: none;
	position: absolute;
	top: calc(100% + 4px);
	right: 0;
	background: #fff;
	border: 1px solid var(--color-border);
	border-radius: 8px;
	box-shadow: 0 4px 16px rgba(0,0,0,.10);
	min-width: 140px;
	z-index: 200;
	overflow: hidden;
}
.pp-new-dropdown.open .pp-new-menu { display: block; }
.pp-new-menu-item {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	padding: 9px 14px;
	font-size: 13px;
	font-weight: 500;
	color: var(--color-text);
	background: none;
	border: none;
	cursor: pointer;
	text-align: left;
}
.pp-new-menu-item:hover { background: #f8fafc; }
.pp-action-btn-outline {
	background: none;
	border: 1px solid #e2e8f0;
	color: #475569;
}
.pp-action-btn-outline:hover {
	background: #f8fafc;
	border-color: var(--color-border-strong);
	color: #1e293b;
}
.pp-action-btn-danger {
	background: none;
	border: 1px solid #fecaca;
	color: #ef4444;
}
.pp-action-btn-danger:hover {
	background: #fef2f2;
	border-color: #ef4444;
	color: #dc2626;
}
.ps-edit-btn-icon {
	padding: 5px 7px;
	min-width: 0;
}
/* Stage bar */
.cpd-stage-bar {
	background: white;
	border-bottom: 1px solid #e2e8f0;
	padding: 0 32px;
	flex-shrink: 0;
	overflow-x: auto;
}
.cpd-stage-steps {
	display: flex;
	align-items: stretch;
	min-width: max-content;
}
.cpd-stage-step {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 11px 16px 11px 0;
	font-size: 12px;
	font-weight: 500;
	color: #94a3b8;
	cursor: pointer;
	position: relative;
	white-space: nowrap;
}
.cpd-stage-step:not(:last-child)::after {
	content: "";
	position: absolute;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 0;
	height: 0;
	border-top: 6px solid transparent;
	border-bottom: 6px solid transparent;
	border-left: 8px solid #e2e8f0;
}
.cpd-stage-step:not(:first-child) {
	padding-left: 16px;
}
.cpd-stage-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #e2e8f0;
	flex-shrink: 0;
}
.cpd-stage-step.done {
	color: #6b7280;
}
.cpd-stage-step.done .cpd-stage-dot {
	background: var(--color-success);
}
.cpd-stage-step.current {
	color: #1a56db;
	font-weight: 600;
}
.cpd-stage-step.current .cpd-stage-dot {
	background: #1a56db;
	box-shadow: 0 0 0 3px #dbeafe;
}
.cpd-stage-step:hover:not(.current) {
	color: #374151;
}
/* Body layout (sidebar on the RIGHT) */
.cpd-body {
	flex: 1;
	display: flex;
	overflow: hidden;
}
.cpd-main {
	flex: 1;
	overflow-y: auto;
	min-width: 0;
}
.cpd-sidebar {
	width: 400px;
	flex-shrink: 0;
	border-left: 1px solid #e2e8f0;
	background: white;
	overflow-y: auto;
	padding: 20px;
}
/* Sidebar sections */
.cs-section {
	margin-bottom: 20px;
	padding-bottom: 20px;
	border-bottom: 1px solid #f1f5f9;
}
.cs-section:last-child {
	border-bottom: none;
	margin-bottom: 0;
}
.cs-section-title {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #94a3b8;
	margin-bottom: 12px;
	display: flex;
	align-items: center;
	gap: 6px;
}
.cs-section-edit-btn {
	display: flex;
	align-items: center;
	gap: 4px;
	font-size: 11px;
	font-weight: 500;
	color: #94a3b8;
	background: none;
	border: none;
	cursor: pointer;
	padding: 2px 4px;
	border-radius: 4px;
	text-transform: none;
	letter-spacing: 0;
}
.cs-section-edit-btn:hover { color: #475569; background: #f1f5f9; }
.pps-divider {
	border: none;
	border-top: 1px solid var(--color-border);
	margin: 12px 0;
}
.pp-person-sidebar .cs-row { border-bottom: none; }
.cs-inv-row {
	padding: 8px 0;
	border-bottom: 1px solid var(--color-border);
}
.cs-inv-row:last-child {
	border-bottom: none;
}

/* ── QV Opportunity action buttons ── */
.qv-delete-zone {
	padding: 16px 0 8px;
	border-top: 1px solid var(--color-border);
	margin-top: 8px;
}
.qv-opp-actions {
	padding-top: 10px;
	border-top: 1px solid var(--color-border);
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.qv-opp-action-btn {
	width: 100%;
	justify-content: center;
}
.qv-opp-row2 {
	display: flex;
	gap: 6px;
}
.qv-opp-row2 .btn {
	flex: 1;
	justify-content: center;
}
.btn-link-danger {
	background: none;
	border: none;
	padding: 4px 0;
	font-size: 12px;
	color: var(--color-text-muted);
	cursor: pointer;
	text-align: center;
	width: 100%;
	text-decoration: underline;
	text-underline-offset: 2px;
}
.btn-link-danger:hover {
	color: var(--color-danger);
}

/* ── Opp flags — chip style ── */
.opp-flag-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 8px 20px 10px;
}
.opp-chip {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 3px 10px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 500;
	background: #f1f5f9;
	color: #94a3b8;
	cursor: pointer;
	user-select: none;
	transition: background 0.12s, color 0.12s;
}
.opp-chip:hover { background: #e2e8f0; color: #475569; }
.opp-chip--on { background: var(--color-primary-light); color: var(--color-primary); }
.opp-chip--on:hover { background: #dbeafe; }
.opp-chip-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: currentColor;
	flex-shrink: 0;
}

/* ── Opp flags — legacy (kept for compat) ── */
.qv-flags-row { display: flex; gap: 16px; padding: 6px 0 4px; flex-wrap: wrap; }
.qv-flag-item { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; cursor: pointer; user-select: none; }
.qv-flag-item input[type="checkbox"] {
	width: 14px;
	height: 14px;
	accent-color: var(--color-primary, #3b82f6);
	cursor: pointer;
	flex-shrink: 0;
}
.qv-flag-item:has(input:checked) {
	color: var(--color-text);
	font-weight: 500;
}

/* ── Opp flag toggle (GST / Biometria / Rush / Refusal) ── */
.opp-flag-toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	user-select: none;
}
.opp-flag-toggle input[type="checkbox"] {
	appearance: none;
	-webkit-appearance: none;
	width: 32px;
	height: 18px;
	background: #d1d5db;
	border-radius: 9px;
	position: relative;
	cursor: pointer;
	flex-shrink: 0;
	transition: background 0.15s;
}
.opp-flag-toggle input[type="checkbox"]::after {
	content: '';
	position: absolute;
	top: 2px;
	left: 2px;
	width: 14px;
	height: 14px;
	background: #fff;
	border-radius: 50%;
	transition: left 0.15s;
	box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.opp-flag-toggle input[type="checkbox"]:checked {
	background: var(--color-primary, #3b82f6);
}
.opp-flag-toggle input[type="checkbox"]:checked::after {
	left: 16px;
}
.opp-flag-toggle .flag-lbl {
	font-size: 13px;
	color: var(--color-text-muted);
}
.opp-flag-toggle input[type="checkbox"]:checked ~ .flag-lbl {
	color: var(--color-text);
	font-weight: 500;
}

.cs-row {
	display: flex;
	align-items: flex-start;
	gap: 15px;
	margin-bottom: 8px;
}
.cs-row:last-child {
	margin-bottom: 0;
}
.cs-icon {
	color: #94a3b8;
	flex-shrink: 0;
	margin-top: 1px;
}
.cs-label {
	font-size: 11px;
	color: #94a3b8;
	min-width: 68px;
	flex-shrink: 0;
	margin-top: 1px;
}
.cs-val {
	font-size: 13px;
	color: #374151;
	font-weight: 500;
}
.cs-val.link {
	color: #1a56db;
	cursor: pointer;
}
.cs-val.link:hover {
	text-decoration: underline;
}
/* Drive button */
.cpd-drive-btn {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	padding: 9px 14px;
	border-radius: 8px;
	border: 1px solid #e2e8f0;
	background: #f8fafc;
	font-size: 13px;
	font-weight: 500;
	color: #374151;
	text-decoration: none;
	cursor: pointer;
}
.cpd-drive-btn:hover {
	background: #eff6ff;
	border-color: #93c5fd;
	color: #1a56db;
}
/* Stage pill variants */
.pill-stage {
	background: #f1f5f9;
	color: #475569;
}
.pill-active {
	background: #dcfce7;
	color: #15803d;
}
.pill-open {
	background: #dbeafe;
	color: #1d4ed8;
}
.pill-won {
	background: #dcfce7;
	color: #15803d;
}

/* ── Notes improvements ── */
.notes-date-sep {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 12px 0 8px;
	color: #94a3b8;
	font-size: 11px;
}
.notes-date-sep::before,
.notes-date-sep::after {
	content: "";
	flex: 1;
	height: 1px;
	background: #f1f5f9;
}
.notes-empty-cta {
	text-align: center;
	padding: 32px 0;
	color: #94a3b8;
	font-size: 13px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
}
.notes-empty-cta button {
	font-size: 12px;
	font-weight: 500;
	color: #2563eb;
	background: #eff6ff;
	border: 1px solid #bfdbfe;
	border-radius: 6px;
	padding: 6px 14px;
	cursor: pointer;
}
.notes-empty-cta button:hover {
	background: #dbeafe;
}
.notes-load-more {
	display: block;
	width: 100%;
	text-align: center;
	padding: 10px;
	font-size: 12px;
	color: #64748b;
	background: none;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	cursor: pointer;
	margin-top: 8px;
}
.notes-load-more:hover {
	background: #f8fafc;
}
/* Composer fix */
.notes-form {
	display: flex;
	flex-direction: column;
	gap: 0;
	margin-bottom: 16px;
}
.notes-textarea {
	border: 1px solid #e2e8f0;
	border-bottom: none;
	border-radius: 8px 8px 0 0;
	padding: 10px 12px;
	font: inherit;
	font-size: 13px;
	color: #374151;
	resize: none;
	min-height: 64px;
	outline: none;
	width: 100%;
	background: white;
}
.notes-textarea:focus {
	border-color: #93c5fd;
}
.notes-form-footer {
	display: flex;
	justify-content: flex-end;
	padding: 8px 12px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-top: 1px solid #f1f5f9;
	margin-top: 0;
	border-radius: 0 0 8px 8px;
}
/* cs-row copy button */
.cs-copy-btn {
	opacity: 0;
	background: none;
	border: none;
	cursor: pointer;
	color: #94a3b8;
	padding: 1px 3px;
	border-radius: 4px;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	transition: opacity 0.15s;
}
.cs-row:hover .cs-copy-btn {
	opacity: 1;
}
.cs-copy-btn:hover {
	color: #2563eb;
	background: #eff6ff;
}
/* Sidebar stage/urgency dropdown */
.cpd-dropdown-wrapper {
	position: relative;
}
.cpd-dropdown-trigger {
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 4px;
}
.cpd-dropdown-trigger::after {
	content: "▾";
	font-size: 9px;
	color: #94a3b8;
}
.cpd-dropdown-trigger:hover {
	opacity: 0.8;
}
.cpd-dropdown-menu {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	background: white;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	box-shadow: var(--shadow-md);
	z-index: 200;
	min-width: 180px;
	padding: 4px 0;
}
.cpd-dropdown-item {
	display: block;
	width: 100%;
	text-align: left;
	padding: 8px 14px;
	font-size: 13px;
	color: #374151;
	background: none;
	border: none;
	cursor: pointer;
}
.cpd-dropdown-item:hover {
	background: #f1f5f9;
}
.cpd-dropdown-item.selected {
	color: #1d4ed8;
	font-weight: 600;
	background: #eff6ff;
}
/* Estágio tab */
.cpd-stage-list {
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.cpd-stage-list-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	border-radius: 8px;
	border: 1px solid #e2e8f0;
	cursor: pointer;
	background: white;
	font-size: 13px;
	color: #374151;
	transition: border-color 0.15s;
}
.cpd-stage-list-item:hover {
	border-color: #93c5fd;
	background: #f8fafc;
}
.cpd-stage-list-item.current {
	border-color: #2563eb;
	background: #eff6ff;
	color: #1d4ed8;
	font-weight: 600;
}
.cpd-stage-list-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #e2e8f0;
	flex-shrink: 0;
}
.cpd-stage-list-item.current .cpd-stage-list-dot {
	background: #2563eb;
}
.cpd-stage-list-item.done .cpd-stage-list-dot {
	background: var(--color-success);
}
.cpd-stage-list-item.done {
	color: #6b7280;
}
/* Dados do cliente tab */
.cpd-client-section {
	margin-bottom: 20px;
}
.cpd-client-title {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #94a3b8;
	margin-bottom: 10px;
}
.cpd-client-row {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	padding: 6px 0;
	border-bottom: 1px solid #f8fafc;
	font-size: 13px;
}
.cpd-client-row:last-child {
	border-bottom: none;
}
.cpd-client-label {
	color: #94a3b8;
	min-width: 120px;
	flex-shrink: 0;
}
.cpd-client-val {
	color: #374151;
	font-weight: 500;
	word-break: break-word;
}
.cpd-edit-profile-link {
	font-size: 12px;
	color: #2563eb;
	cursor: pointer;
	background: none;
	border: none;
	padding: 0;
	text-decoration: underline;
}
.cpd-other-cases {
	margin-top: 16px;
}
.cpd-other-case-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	border-radius: 6px;
	border: 1px solid #e2e8f0;
	margin-bottom: 6px;
	cursor: pointer;
	background: white;
	font-size: 12px;
}
.cpd-other-case-item:hover {
	border-color: #93c5fd;
}
/* Mention in notes feed */
.mention {
	color: #1a56db;
	font-weight: 500;
}

/* Legacy section classes (kept for QV compatibility) */
.pps-section {
	padding: 12px 20px;
	border-bottom: 1px solid #f1f5f9;
}
.pps-section:last-child {
	border-bottom: none;
}
.pps-section-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 8px;
}
.pps-section-title {
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	color: #94a3b8;
}
.pps-edit-btn {
	background: none;
	border: none;
	color: #94a3b8;
	padding: 2px 4px;
	border-radius: 4px;
	display: flex;
	align-items: center;
	cursor: pointer;
}
.pps-edit-btn:hover {
	color: #374151;
	background: #f1f5f9;
}
.pps-about-text {
	font-size: 12px;
	color: #475569;
	line-height: 1.65;
	padding: 7px 10px;
	background: #f8fafc;
	border-radius: 6px;
	border: 1px solid #e2e8f0;
	white-space: pre-wrap;
	word-break: break-word;
}
.pps-empty {
	color: #c9d4e0;
	font-style: italic;
}
.pps-about-edit {
	width: 100%;
	border: 1px solid var(--color-border-strong);
	border-radius: 6px;
	padding: 8px 10px;
	font: inherit;
	font-size: 12px;
	color: #374151;
	resize: vertical;
	min-height: 80px;
	background: white;
}
.pps-about-edit:focus {
	outline: none;
	border-color: #93c5fd;
}
/* QV: Sobre read-only text */
.qv-about-text {
	font-size: 12px;
	color: #475569;
	line-height: 1.65;
	padding: 7px 10px;
	background: #f8fafc;
	border-radius: 6px;
	border: 1px solid #e2e8f0;
	white-space: pre-wrap;
	word-break: break-word;
	margin-top: 4px;
}

/* Case page header: person chip */
.case-page-person-chip {
	font-size: 14px;
	font-weight: 500;
	color: #475569;
	margin-left: 10px;
	padding-left: 10px;
	border-left: 1px solid #e2e8f0;
}

/* ── CPD inline breadcrumb header ────────────────────────────── */
.cpd-inline-breadcrumb {
	display: flex;
	align-items: center;
	gap: 0;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.cpd-bc-person {
	color: #4b80d4;
	text-decoration: none;
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 280px;
}
.cpd-bc-person:hover {
	text-decoration: underline;
}
.cpd-bc-sep {
	color: #94a3b8;
	font-weight: 400;
	margin: 0 6px;
	flex-shrink: 0;
}
.cpd-bc-service {
	color: #0f172a;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ── CPD sidebar dropdown buttons ────────────────────────────── */
.cpd-sidebar-dd-btn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	font-size: 12px;
	color: inherit;
}
.cpd-sidebar-dd-btn:hover {
	opacity: 0.75;
}
.cpd-dd-chevron {
	color: #94a3b8;
	flex-shrink: 0;
}

/* ── CPD inline dropdown menu ────────────────────────────────── */
.cpd-dd-menu {
	position: fixed;
	background: white;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	box-shadow: var(--shadow-md);
	overflow: hidden;
	display: flex;
	flex-direction: column;
}
.cpd-dd-item {
	background: none;
	border: none;
	padding: 8px 14px;
	text-align: left;
	font-size: 13px;
	color: #374151;
	cursor: pointer;
	white-space: nowrap;
}
.cpd-dd-item:hover {
	background: #f1f5f9;
}
.cpd-dd-item.active {
	color: #1a56db;
	font-weight: 600;
	background: #eff6ff;
}

/* ── CPD Estágio tab ─────────────────────────────────────────── */
.cpd-stage-tab {
	padding: 4px 0;
}
.cpd-stage-tab-title {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #94a3b8;
	margin-bottom: 12px;
}
.cpd-stage-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.cpd-stage-option {
	padding: 7px 14px;
	border: 1px solid #e2e8f0;
	border-radius: 20px;
	background: white;
	font-size: 12px;
	font-weight: 500;
	color: #374151;
	cursor: pointer;
	transition: all 0.15s;
}
.cpd-stage-option:hover {
	border-color: #1a56db;
	color: #1a56db;
	background: #eff6ff;
}
.cpd-stage-option.active {
	background: #1a56db;
	color: white;
	border-color: #1a56db;
}

/* ── Stage Timeline (Estágio tab stepper) ────────────────────── */
.stage-timeline { display: flex; flex-direction: column; gap: 0; padding: 8px 0; }
.stl-item { display: flex; align-items: flex-start; gap: 12px; padding: 6px 0; cursor: pointer; border-radius: 6px; transition: background 0.1s; }
.stl-item:not(.stl-active):hover { background: var(--color-bg); }
.stl-item:not(.stl-active):hover .stl-label { color: var(--color-primary); }
.stl-active { cursor: default; }
.stl-marker { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #cbd5e1; background: white; flex-shrink: 0; margin-top: 3px; }
.stl-done .stl-marker { background: var(--color-success); border-color: var(--color-success); }
.stl-active .stl-marker { background: var(--color-primary); border-color: var(--color-primary); box-shadow: 0 0 0 3px #dbeafe; }
.stl-label { font-size: 13px; color: var(--color-text); font-weight: 500; }
.stl-done .stl-label { color: var(--color-muted); font-weight: 400; }
.stl-active .stl-label { color: var(--color-primary); font-weight: 600; }
.stl-future .stl-label { color: #cbd5e1; font-weight: 400; }
.stl-date { font-size: 11px; color: var(--color-muted); margin-top: 1px; }
.stl-hint { font-size: 11px; color: var(--color-muted); font-style: italic; margin-top: 1px; display: none; }
.stl-item:not(.stl-active):hover .stl-hint { display: block; }
/* Connector line between items */
.stl-item:not(:last-child) { position: relative; }
.stl-item:not(:last-child)::after { content: ''; position: absolute; left: 5px; top: 20px; width: 2px; height: calc(100% - 8px); background: #e2e8f0; }
.stl-done:not(:last-child)::after { background: var(--color-success); opacity: 0.4; }

/* ── CPD Stage history timeline ──────────────────────────────── */
.cpd-stage-history {
	display: flex;
	flex-direction: column;
	gap: 0;
}
.cpd-history-item {
	display: flex;
	gap: 12px;
	position: relative;
	padding-bottom: 16px;
}
.cpd-history-item::before {
	content: "";
	position: absolute;
	left: 5px;
	top: 14px;
	bottom: 0;
	width: 1px;
	background: #e2e8f0;
}
.cpd-history-item:last-child::before {
	display: none;
}
.cpd-history-dot {
	width: 11px;
	height: 11px;
	border-radius: 50%;
	background: #1a56db;
	flex-shrink: 0;
	margin-top: 2px;
	box-shadow: 0 0 0 3px #dbeafe;
}
.cpd-history-body {
	flex: 1;
	min-width: 0;
}
.cpd-history-label {
	font-size: 13px;
	color: #1e293b;
	line-height: 1.4;
}
.cpd-history-from {
	color: #94a3b8;
}
.cpd-history-meta {
	font-size: 11px;
	color: #94a3b8;
	margin-top: 2px;
}
.cpd-history-empty {
	font-size: 13px;
	color: #94a3b8;
	padding: 4px 0;
}

/* ── CPD Dados do Cliente tab ────────────────────────────────── */
.cpd-edit-link {
	font-size: 12px;
	color: #1a56db;
	text-decoration: none;
	font-weight: 500;
}
.cpd-edit-link:hover {
	text-decoration: underline;
}

/* ── Notes: date separators ──────────────────────────────────── */
.note-date-sep {
	text-align: center;
	font-size: 11px;
	font-weight: 600;
	color: #94a3b8;
	letter-spacing: 0.04em;
	padding: 12px 0 6px;
	position: relative;
}
.note-date-sep::before,
.note-date-sep::after {
	content: "";
	position: absolute;
	top: 50%;
	width: calc(50% - 48px);
	height: 1px;
	background: #e2e8f0;
}
.note-date-sep::before {
	left: 0;
}
.note-date-sep::after {
	right: 0;
}

/* ── Notes: empty state with CTA ─────────────────────────────── */
.notes-empty-cta {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	padding: 32px 0;
}
.notes-empty-msg {
	font-size: 13px;
	color: #94a3b8;
}

/* ── Notes: load more ────────────────────────────────────────── */
.notes-load-more {
	text-align: center;
	padding: 12px 0 4px;
}
.notes-load-more-btn {
	background: none;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	padding: 6px 16px;
	font-size: 12px;
	color: #475569;
	cursor: pointer;
	font-weight: 500;
}
.notes-load-more-btn:hover {
	background: #f8fafc;
	border-color: var(--color-border-strong);
}

/* ── Settings ────────────────────────────────────────────────── */
.settings-wrap {
	padding: 24px 32px;
}
.settings-tab-bar {
	display: flex;
	align-items: center;
	gap: 2px;
	border-bottom: 1px solid var(--color-border);
	margin-bottom: 24px;
	padding-bottom: 0;
}
.settings-tab-bar .filter-tab {
	border-radius: 6px 6px 0 0;
	padding: 7px 16px;
	margin-bottom: -1px;
	border-bottom: 2px solid transparent;
}
.settings-tab-bar .filter-tab.active {
	background: none;
	color: var(--color-primary);
	border-bottom: 2px solid var(--color-primary);
	font-weight: 600;
}
.settings-tab-body {
	overflow-y: auto;
	max-height: calc(100vh - 120px);
}
.settings-readonly-tag {
	font-size: 12px;
	color: var(--color-muted);
	background: #f1f5f9;
	padding: 3px 10px;
	border-radius: 20px;
}
/* ── Serviços tab ── */
.settings-serv-filters {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 16px;
	flex-wrap: wrap;
}
.settings-serv-search {
	width: 220px;
	height: 34px;
	font-size: 13px;
	padding: 0 10px;
}
.settings-serv-table {
	width: auto;
	min-width: 500px;
}
.settings-serv-table td {
	padding: 12px 16px;
}
.settings-serv-name {
	font-size: 14px;
	font-weight: 500;
	color: var(--color-text);
}
.settings-serv-name-pt {
	font-size: 12px;
	color: var(--color-muted);
	margin-top: 1px;
}
.settings-serv-cat-row td {
	background: #f8fafc;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--color-muted);
	padding: 6px 16px !important;
}
.settings-gst-badge {
	font-size: 11px;
	font-weight: 600;
	color: #16a34a;
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	border-radius: 4px;
	padding: 1px 6px;
}
/* ── Draft tabs (Financeiro / Estágios / Checklist) ── */
.settings-draft-notice {
	display: flex;
	align-items: center;
	gap: 8px;
	background: #fffbeb;
	border: 1px solid #fde68a;
	border-radius: 8px;
	padding: 10px 14px;
	font-size: 13px;
	color: #92400e;
	margin-bottom: 24px;
}
.settings-draft-group {
	margin-bottom: 28px;
}
.settings-draft-group-title {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--color-muted);
	margin-bottom: 12px;
}
.settings-draft-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}
.settings-draft-field label {
	display: block;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--color-muted);
	margin-bottom: 4px;
}
.settings-draft-field input,
.settings-draft-field select {
	width: 100%;
	height: 36px;
	padding: 0 10px;
	font-size: 13px;
	border: 1px solid var(--color-border);
	border-radius: 6px;
	background: #f9fafb;
	color: var(--color-muted);
	cursor: not-allowed;
}
.settings-stage-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 0;
	border-bottom: 1px solid #f1f5f9;
	font-size: 14px;
}
.settings-stage-row:last-child { border-bottom: none; }
.settings-stage-num {
	width: 24px;
	height: 24px;
	background: #f1f5f9;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	font-weight: 700;
	color: var(--color-muted);
	flex-shrink: 0;
}
.settings-stage-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	flex-shrink: 0;
}
.settings-stage-name {
	flex: 1;
	font-weight: 500;
}
.settings-stage-key {
	font-size: 12px;
	color: var(--color-muted);
	font-family: monospace;
}
/* ── Usuários table (consistent with data-table) ── */
.settings-users-table td {
	padding: 14px 16px;
	vertical-align: middle;
}
.settings-user-avatar-sm {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 700;
	color: white;
	flex-shrink: 0;
}
.settings-loading {
	color: var(--color-muted);
	font-size: 14px;
	padding: 24px 0;
}
.settings-section {
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	padding: 24px;
}
.settings-section-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 20px;
}
.settings-section-title {
	font-size: 15px;
	font-weight: 600;
	color: var(--color-text);
}
.settings-empty {
	font-size: 13px;
	color: var(--color-muted);
	padding: 12px 0;
}

/* User list */
.settings-user-list {
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.settings-user-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border-radius: 6px;
	transition: background 0.1s;
}
.settings-user-row:hover {
	background: var(--color-bg);
}
.settings-user-inactive {
	opacity: 0.55;
}
.settings-user-avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: var(--color-primary);
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.settings-user-info {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-width: 0;
}
.settings-user-name {
	font-size: 13px;
	font-weight: 500;
	color: var(--color-text);
}
.settings-user-email {
	font-size: 12px;
	color: var(--color-muted);
}
.settings-user-actions {
	display: flex;
	gap: 6px;
	align-items: center;
}

/* Badges */
.settings-badge {
	font-size: 11px;
	font-weight: 500;
	padding: 2px 8px;
	border-radius: 10px;
	white-space: nowrap;
}
.settings-badge-active {
	background: #dcfce7;
	color: #166534;
}
.settings-badge-inactive {
	background: #f1f5f9;
	color: #64748b;
}

/* Permission matrix */
.settings-matrix-wrap {
	overflow-x: auto;
}
.settings-matrix {
	width: 100%;
	border-collapse: collapse;
	font-size: 12px;
}
.settings-matrix thead th {
	text-align: center;
	padding: 8px 6px;
	font-weight: 600;
	color: var(--color-muted);
	border-bottom: 1px solid var(--color-border);
	white-space: nowrap;
}
.settings-matrix-user-col {
	text-align: left !important;
	min-width: 120px;
}
.settings-matrix tbody tr:hover {
	background: var(--color-bg);
}
.settings-matrix-row-me {
	background: #f8fafc;
}
.settings-matrix td {
	padding: 7px 6px;
	text-align: center;
	border-bottom: 1px solid #f1f5f9;
}
.settings-matrix-user-name {
	text-align: left;
	font-weight: 500;
	color: var(--color-text);
	padding-left: 0 !important;
}
.settings-me-label {
	font-size: 11px;
	color: var(--color-muted);
	font-weight: 400;
}
.settings-perm-select {
	width: 90px;
	padding: 4px 6px;
	border: 1px solid var(--color-border);
	border-radius: 4px;
	font-size: 12px;
	background: #fff;
	color: var(--color-text);
}
.settings-perm-readonly {
	font-size: 12px;
	color: var(--color-muted);
}

/* Profile preset buttons */
.settings-profile-btns {
	display: flex;
	gap: 8px;
	margin-top: 6px;
}
.settings-profile-btn {
	background: #f1f5f9;
	color: var(--color-muted);
}
.settings-profile-btn.active {
	background: var(--color-primary);
	color: #fff;
	border-color: var(--color-primary);
}

/* Deactivate modal */
.settings-deactivate-msg {
	font-size: 13px;
	color: var(--color-text);
	line-height: 1.5;
}
.settings-reassign-warn {
	font-size: 12px;
	color: #92400e;
	background: #fef3c7;
	border: 1px solid #fde68a;
	border-radius: 4px;
	padding: 8px 10px;
	margin-top: 8px;
}

/* No-access screen */
.no-access-screen {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	margin: auto;
	background: var(--color-bg);
}
.no-access-card {
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: 16px;
	padding: 48px 40px;
	width: 380px;
	text-align: center;
	box-shadow: var(--shadow-md);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}
.no-access-avatar {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--color-primary);
	color: #fff;
	font-size: 18px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
}
.no-access-name {
	font-size: 15px;
	font-weight: 600;
	color: var(--color-text);
}
.no-access-icon {
	font-size: 32px;
	margin: 4px 0;
}
.no-access-title {
	font-size: 18px;
	font-weight: 700;
	color: var(--color-text);
}
.no-access-msg {
	font-size: 13px;
	color: var(--color-muted);
	line-height: 1.6;
}
.no-access-contact {
	width: 100%;
	margin-top: 8px;
}
.no-access-signout {
	width: 100%;
	font-size: 13px;
}

/* ── COMBOBOX ── */
.combo-wrap { position: relative; }

.combo-input {
	width: 100%; height: 36px;
	padding: 0 30px 0 10px;
	border: 1px solid var(--color-border);
	border-radius: 6px;
	font-size: 13px; color: var(--color-text);
	background: #fff; outline: none;
	transition: border-color 0.15s, box-shadow 0.15s;
	font-family: inherit;
}
.combo-input:focus {
	border-color: #93c5fd;
	box-shadow: 0 0 0 3px rgba(147,197,253,0.25);
}
.combo-input::placeholder { color: var(--color-muted); }

.combo-chevron {
	position: absolute; right: 10px; top: 50%;
	transform: translateY(-50%);
	opacity: 0.35; pointer-events: none;
	transition: transform 0.18s ease, opacity 0.15s;
	color: var(--color-text);
}
.combo-wrap.open .combo-chevron {
	transform: translateY(-50%) rotate(180deg);
	opacity: 0.55;
}

.combo-dropdown {
	position: absolute; top: calc(100% + 4px); left: 0; right: 0;
	background: #fff;
	border: 1px solid var(--color-border);
	border-radius: 6px;
	box-shadow: 0 4px 16px rgba(0,0,0,0.10), 0 1px 4px rgba(0,0,0,0.06);
	z-index: 600; display: none; overflow: hidden;
}
.combo-wrap.open .combo-dropdown { display: block; }

.combo-list {
	max-height: 220px; overflow-y: auto; padding: 4px 0;
	scrollbar-width: thin; scrollbar-color: transparent transparent;
}
.combo-list:hover { scrollbar-color: #cbd5e1 transparent; }
.combo-list::-webkit-scrollbar { width: 3px; }
.combo-list::-webkit-scrollbar-track { background: transparent; }
.combo-list::-webkit-scrollbar-thumb { background: transparent; border-radius: 99px; }
.combo-list:hover::-webkit-scrollbar-thumb { background: #cbd5e1; }

.combo-option {
	display: flex; align-items: center;
	padding: 7px 10px; cursor: pointer; gap: 10px;
	transition: background 0.1s;
}
.combo-option:hover,
.combo-option.combo-highlighted { background: #f1f5f9; }
.combo-option.combo-selected { background: #eff6ff; }

.combo-option-info { flex: 1; min-width: 0; }
.combo-option-name {
	font-size: 13px; font-weight: 500; color: var(--color-text);
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.combo-option-sub {
	font-size: 11px; color: var(--color-muted); margin-top: 1px;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.combo-check { color: var(--color-primary); flex-shrink: 0; opacity: 0; }
.combo-option.combo-selected .combo-check { opacity: 1; }
.combo-empty {
	padding: 12px 10px; font-size: 13px;
	color: var(--color-muted); text-align: center;
}
.combo-group-label {
	padding: 8px 10px 4px;
	font-size: 10px; font-weight: 700;
	letter-spacing: 0.07em; text-transform: uppercase;
	color: var(--color-muted);
}
.combo-group-label:not(:first-child) {
	border-top: 1px solid var(--color-border);
	margin-top: 4px; padding-top: 10px;
}
.combo-option-name mark {
	background: #fef9c3; color: inherit;
	border-radius: 2px; padding: 0 1px;
}

/* ── CHIPS (Informação Adicional) ── */
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
	display: inline-flex; align-items: center; gap: 5px;
	padding: 4px 10px;
	border: 1px solid var(--color-border);
	border-radius: 5px;
	font-size: 12px; font-weight: 500;
	color: var(--color-text-secondary);
	background: #fff;
	cursor: pointer; user-select: none;
	transition: border-color 0.12s, background 0.12s, color 0.12s;
	white-space: nowrap;
}
.chip:hover { border-color: #cbd5e1; background: #f8fafc; }
.chip.active {
	border-color: #bfdbfe;
	background: #eff6ff;
	color: var(--color-primary);
}
.chip-dot {
	width: 6px; height: 6px; border-radius: 50%;
	background: currentColor; opacity: 0.5; flex-shrink: 0;
	transition: opacity 0.12s;
}
.chip.active .chip-dot { opacity: 1; }

/* ── CPD urgency toggle (checkbox) ──────────────────────────── */
.cs-urgency-toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
	font-size: 13px;
	color: #374151;
	font-weight: 500;
	user-select: none;
}
.cs-urgency-toggle input[type="checkbox"] {
	accent-color: #f59e0b;
	width: 14px;
	height: 14px;
	cursor: pointer;
	flex-shrink: 0;
}

/* ── Checklist Stage 1 ───────────────────────────────────────── */
.cl-section {
	padding: 20px 24px;
	border-bottom: 1px solid var(--color-border);
}
.cl-banner {
	background: #fef3c7;
	border: 1px solid #fbbf24;
	color: #92400e;
	font-size: 12px;
	padding: 8px 12px;
	border-radius: 6px;
	margin-bottom: 14px;
}
.cl-form-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 24px;
	align-items: flex-start;
}
.cl-field {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 160px;
}
.cl-field-label {
	font-size: 12px;
	font-weight: 500;
	color: var(--color-text-muted);
}
.cl-check-field {
	flex-direction: row;
	align-items: center;
	gap: 8px;
	min-width: unset;
	cursor: pointer;
	padding-top: 18px;
}
.cl-check-field input[type="checkbox"] {
	width: 15px;
	height: 15px;
	accent-color: var(--color-accent);
	cursor: pointer;
	flex-shrink: 0;
}
.cl-select {
	font-size: 13px;
	border: 1px solid var(--color-border);
	border-radius: 6px;
	padding: 5px 10px;
	color: var(--color-text);
	background: var(--color-bg);
	cursor: pointer;
}
.cl-owp-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	flex: 1 1 100%;
}
.cl-owp-options {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
}
.cl-radio {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: var(--color-text);
	cursor: pointer;
}
.cl-radio input[type="radio"] {
	accent-color: var(--color-accent);
	width: 14px;
	height: 14px;
	cursor: pointer;
}
/* Result area */
.cl-result {
	padding: 20px 24px;
}
.cl-result-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
}
.cl-result-count {
	font-size: 13px;
	font-weight: 600;
	color: var(--color-text);
}
.cl-sec-title {
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--color-text-muted);
	padding: 14px 0 6px;
	border-bottom: 1px solid var(--color-border);
	margin-bottom: 4px;
}
.cl-doc-item {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 7px 0;
	cursor: pointer;
	border-bottom: 1px solid #f3f4f6;
}
.cl-doc-item:last-child { border-bottom: none; }
.cl-doc-check {
	width: 15px;
	height: 15px;
	accent-color: var(--color-accent);
	cursor: pointer;
	flex-shrink: 0;
	margin-top: 2px;
}
.cl-doc-text {
	display: flex;
	flex-direction: column;
	gap: 1px;
	flex: 1;
}
.cl-doc-label {
	font-size: 13px;
	color: var(--color-text);
	font-weight: 500;
}
.cl-doc-hint {
	font-size: 11px;
	color: var(--color-text-muted);
}
.cl-doc-custom {
	align-items: center;
}
.cl-doc-remove {
	background: none;
	border: none;
	color: #94a3b8;
	cursor: pointer;
	font-size: 16px;
	padding: 0 4px;
	line-height: 1;
	flex-shrink: 0;
}
.cl-doc-remove:hover { color: #ef4444; }
/* Add item */
.cl-add-item {
	display: flex;
	gap: 8px;
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px solid var(--color-border);
}
.cl-custom-input {
	flex: 1;
	font-size: 13px;
	border: 1px solid var(--color-border);
	border-radius: 6px;
	padding: 6px 10px;
	color: var(--color-text);
	background: var(--color-bg);
}
.cl-custom-input:focus {
	outline: 2px solid var(--color-accent);
	outline-offset: 1px;
}
/* Print header (hidden on screen) */
.cl-print-header { display: none; }

/* ── Checklist Stage 2 (cl2-) ───────────────────────────────── */
.cl2-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 48px 24px;
	text-align: center;
	gap: 10px;
}
.cl2-empty-icon {
	width: 40px;
	height: 40px;
	color: #94a3b8;
	margin-bottom: 4px;
}
.cl2-empty-title {
	font-size: 14px;
	font-weight: 600;
	color: var(--color-text);
}
.cl2-empty-hint {
	font-size: 13px;
	color: var(--color-text-muted);
	max-width: 340px;
	line-height: 1.5;
}
.cl2-wrap {
	display: flex;
	flex-direction: column;
	height: 100%;
}
/* view mode: scrollable area */
.cl2-list {
	flex: 1;
	overflow-y: auto;
	padding: 16px 20px;
}
/* view mode: 2-column grid */
.cl2-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
}
.cl2-card {
	border: 1px solid var(--color-border);
	border-radius: 8px;
	overflow: hidden;
	background: white;
}
.cl2-card-title {
	font-size: 14px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #333333;
	background: #f9fafb;
	padding: 7px 12px;
	border-bottom: 1px solid var(--color-border);
}
.cl2-card-items { padding: 4px 0; }
.cl2-card-item {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	padding: 7px 12px;
	border-bottom: 1px solid var(--color-border);
	background: white;
}
.cl2-card-item:last-child { border-bottom: none; }
.cl2-card-item-body { flex: 1; min-width: 0; }
/* edit mode: single-column list */
.cl2-edit-list { padding: 8px 20px; }
.cl2-cat {
	margin-top: 14px;
}
.cl2-cat:first-child { margin-top: 0; }
.cl2-cat:last-child {
	margin-bottom: 8px;
}
.cl2-cat-title {
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #c81e1e;
	padding-bottom: 6px;
	border-bottom: 1.5px solid #fecaca;
	margin-bottom: 2px;
}
.cl2-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 7px 8px;
	border-bottom: 1px solid var(--color-border);
	border-radius: 6px;
}
.cl2-item:last-child { border-bottom: none; }
.cl2-item--custom {
	background: #fffbeb;
	border: 1px solid #fde68a;
	border-radius: 6px;
	margin-top: 3px;
}
.cl2-item--done .cl2-item-name,
.cl2-item-name--done {
	color: var(--color-text-muted);
	text-decoration: line-through;
	text-decoration-color: #cbd5e1;
}
.cl2-cb {
	width: 18px;
	height: 18px;
	border: 2px solid #d1d5db;
	border-radius: 4px;
	background: #fff;
	flex-shrink: 0;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: border-color 0.15s, background 0.15s;
	color: #fff;
}
.cl2-cb:hover:not(.cl2-cb--done) {
	border-color: #c81e1e;
}
.cl2-cb--done {
	background: #16a34a;
	border-color: #16a34a;
}
/* blue checkbox in edit mode for "included" items */
.cl2-cb--included {
	background: #2563eb;
	border-color: #2563eb;
	color: #fff;
	cursor: default;
}
.cl2-item-body {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}
.cl2-item-name {
	font-size: 14px;
	font-weight: 500;
	color: var(--color-text);
	line-height: 1.35;
}
.cl2-item-hint {
	font-size: 12px;
	color: var(--color-text-muted);
	line-height: 1.4;
}
.cl2-tag {
	font-size: 10px;
	font-weight: 600;
	padding: 2px 7px;
	border-radius: 999px;
	flex-shrink: 0;
	white-space: nowrap;
}
.cl2-tag--recebido {
	background: #dcfce7;
	color: #15803d;
}
.cl2-tag--aprovado {
	background: #dbeafe;
	color: #1d4ed8;
}
.cl2-badge-manual {
	font-size: 10px;
	font-weight: 600;
	background: #f3f4f6;
	color: #6b7280;
	padding: 1px 6px;
	border-radius: 4px;
	margin-left: 6px;
	vertical-align: middle;
}
.cl2-remove {
	background: none;
	border: none;
	color: #94a3b8;
	cursor: pointer;
	padding: 4px;
	border-radius: 4px;
	display: flex;
	align-items: center;
	flex-shrink: 0;
}
.cl2-remove:hover { color: #ef4444; background: #fef2f2; }
.cl2-add-form {
	display: flex;
	gap: 8px;
	padding: 12px 20px;
	border-top: 1px solid var(--color-border);
	flex-shrink: 0;
}
.cl2-add-input {
	flex: 1;
	font-size: 13px;
	border: 1px solid var(--color-border);
	border-radius: 6px;
	padding: 5px 10px;
	color: var(--color-text);
	background: var(--color-bg);
	min-width: 0;
}
.cl2-add-input:focus { outline: 2px solid var(--color-accent); outline-offset: 1px; }
.cl2-add-cat {
	font-size: 12px;
	border: 1px solid var(--color-border);
	border-radius: 6px;
	padding: 5px 8px;
	color: var(--color-text);
	background: var(--color-bg);
	cursor: pointer;
}
.cl2-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 20px;
	border-top: 1px solid var(--color-border);
	flex-shrink: 0;
}
.cl2-counter {
	font-size: 12px;
	color: var(--color-text-muted);
	font-weight: 500;
}
.cl2-btns {
	display: flex;
	gap: 8px;
}
/* History section */
.cl2-hist-wrap {
	border-top: 1px solid var(--color-border);
	flex-shrink: 0;
}
.cl2-hist-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 20px;
	font-size: 11px;
	font-weight: 600;
	color: var(--color-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.06em;
}
.cl2-hist-toggle {
	background: none;
	border: none;
	cursor: pointer;
	color: var(--color-text-muted);
	padding: 2px;
	display: flex;
	align-items: center;
}
.cl2-hist-toggle:hover { color: var(--color-text); }
.cl2-hist-rows {
	padding: 0 20px 12px;
}
.cl2-hist-row {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 6px 0;
	border-top: 1px solid var(--color-border);
	font-size: 12px;
}
.cl2-hist-date { color: var(--color-text-muted); flex-shrink: 0; }
.cl2-hist-to { flex: 1; color: var(--color-text); }
.cl2-hist-count { color: var(--color-text-muted); flex-shrink: 0; }
/* Send overlay */
.cl2-send-steps {
	font-size: 11px;
	color: var(--color-text-muted);
	font-weight: 400;
	margin-left: 10px;
}
.cl2-send-list {
	display: flex;
	flex-direction: column;
	gap: 4px;
	max-height: 240px;
	overflow-y: auto;
	background: var(--color-bg-subtle, #f9fafb);
	border: 1px solid var(--color-border);
	border-radius: 8px;
	padding: 10px 12px;
}
.cl2-send-list-item {
	display: flex;
	align-items: flex-start;
	gap: 7px;
	font-size: 13px;
	color: var(--color-text);
	line-height: 1.4;
}
.cl2-send-list-item svg { flex-shrink: 0; margin-top: 3px; }
.cl2-send-list-hint {
	color: var(--color-text-muted);
	font-size: 11px;
}
.cl2-send-body {
	font-family: inherit;
	resize: vertical;
	min-height: 120px;
}

/* ── Print styles ────────────────────────────────────────────── */
@media print {
	/* Hide everything except checklist content */
	body > *:not(#app) { display: none !important; }
	.nav-sidebar, .page-header, .cpd-sidebar, .pp-tab-bar,
	.cl-section, .cl-result-header, .cl-add-item,
	#cp-header-actions, .cpd-urgency-line, .pp-breadcrumb { display: none !important; }
	.cpd-body { display: block !important; }
	.cpd-main { overflow: visible !important; max-height: none !important; }
	.pp-tab-panel { display: block !important; }
	.pp-tab-panel:not(#cp-panel-checklist) { display: none !important; }
	.cl-result { padding: 0 !important; }
	.cl-print-header { display: block !important; margin-bottom: 20px; }
	.cl-print-title { font-size: 18px; font-weight: 700; color: #111; }
	.cl-print-sub { font-size: 13px; color: #555; margin-top: 4px; }
	.cl-sec-title { font-size: 9px; color: #555; }
	.cl-doc-label { font-size: 12px; }
	.cl-doc-hint { font-size: 10px; }
	.cl-doc-check { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
