/**
 * Online-View: kompakte Liste + Detail-Dialog (mobil: Bottom-Sheet).
 */

.ccm-dashboard-online-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0.75rem;
	flex-wrap: wrap;
	margin-bottom: 0.35rem;
}

.ccm-dashboard-online-header .ccm-dashboard-section-title {
	margin-bottom: 0;
}

/* —— Kompakte Liste (nur Benutzername) —— */
.ccm-dashboard-online-compact {
	list-style: none;
	margin: 0;
	padding: 0;
	border: 1px solid #dcdcde;
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
}

.ccm-dashboard-online-compact-item {
	border-bottom: 1px solid #f0f0f1;
	border-radius: 0;
}

.ccm-dashboard-online-compact-item:last-child {
	border-bottom: none;
}

.ccm-dashboard-online-compact-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: stretch;
	gap: 0;
	min-height: 52px;
}

.ccm-dashboard-online-compact-row .ccm-dashboard-online-compact-btn {
	min-width: 0;
	width: 100%;
	max-width: 100%;
}

/* Profil-Icon + Ordner (Userakte), wie im Forum */
.ccm-dashboard-online-quick-icons {
	display: inline-flex;
	align-items: center;
	justify-content: flex-end;
	gap: 0.25rem;
	flex-shrink: 0;
	align-self: center;
	justify-self: end;
	width: auto;
	max-width: none;
	box-sizing: border-box;
	padding: 0 0.55rem 0 0.25rem;
}

.ccm-dashboard-online-icon-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	color: #50575e;
	text-decoration: none !important;
	border-radius: 6px;
	line-height: 1;
	-webkit-tap-highlight-color: transparent;
}

.ccm-dashboard-online-icon-link:visited {
	color: #50575e;
	text-decoration: none !important;
}

.ccm-dashboard-online-icon-link:hover,
.ccm-dashboard-online-icon-link:focus-visible {
	color: #2A6B6B;
	background: color-mix(in srgb, #2A6B6B 8%, white);
	text-decoration: none !important;
}

.ccm-dashboard-online-icon-link:focus-visible {
	outline: 2px solid #2A6B6B;
	outline-offset: 1px;
}

.ccm-dashboard-online-icon-link .dashicons {
	font-size: 20px;
	width: 20px;
	height: 20px;
}

/* Wie die <a>-Icons: Form-Button-Reset (sonst Browser-/Theme-„Primary“-Hintergrund). */
button.ccm-dashboard-online-icon-link {
	margin: 0;
	padding: 0;
	border: none;
	background: transparent;
	box-shadow: none;
	font: inherit;
	line-height: 1;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
}

button.ccm-dashboard-online-icon-link::-moz-focus-inner {
	border: 0;
	padding: 0;
}

.ccm-dashboard-online-card-name-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem 0.55rem;
	row-gap: 0.35rem;
}

.ccm-dashboard-online-role-icon {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
	line-height: 0;
}

.ccm-dashboard-team-badge {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
	font-size: 0.68rem;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.02em;
	padding: 0.12rem 0.38rem;
	border-radius: 4px;
	background: #F08060;
	color: #fff;
	text-transform: none;
}

.ccm-dashboard-online-compact-btn .ccm-dashboard-team-badge {
	margin-left: 0.1rem;
}

.ccm-dashboard-online-role-icon .brm-role-icon,
.ccm-dashboard-online-role-icon .wpxf-role-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.ccm-dashboard-online-quick-icons--detail {
	padding: 0;
	justify-content: flex-start;
	max-width: none;
	width: auto;
}

.ccm-dashboard-online-compact-btn {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	width: 100%;
	min-height: 52px;
	padding: 0.55rem 0.75rem;
	margin: 0;
	border: none !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	cursor: pointer;
	text-align: left;
	font: inherit;
	color: #1d2327 !important;
	-webkit-tap-highlight-color: transparent;
	appearance: none;
	-webkit-appearance: none;
}

.ccm-dashboard-online-compact-btn:hover,
.ccm-dashboard-online-compact-btn:focus-visible {
	background: transparent !important;
	color: #1d2327 !important;
	border-radius: 0 !important;
}

/* Hover über die ganze Zeile — keine Pill-/Button-Rundung */
.ccm-dashboard-online-compact-item:hover,
.ccm-dashboard-online-compact-item:focus-within {
	background-color: rgba(42, 107, 107, 0.06);
}

.ccm-dashboard-online-compact-btn:focus-visible {
	outline: 2px solid #2A6B6B;
	outline-offset: -2px;
}

.ccm-dashboard-online-compact-identity {
	display: flex;
	align-items: center;
	gap: 0.35rem 0.45rem;
	flex: 1 1 auto;
	min-width: 0;
}

.ccm-dashboard-online-compact-login {
	flex: 1 1 auto;
	min-width: 0;
	font-weight: 600;
	font-size: 0.95rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	word-break: normal;
	overflow-wrap: normal;
	color: inherit;
}

.ccm-dashboard-online-compact-chevron {
	flex-shrink: 0;
	color: #646970;
	font-size: 1.25rem;
	line-height: 1;
	font-weight: 300;
}

.ccm-dashboard-presence-light {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	flex-shrink: 0;
	background: #94a3b8;
}

.ccm-dashboard-presence-light--green {
	background: #16a34a;
	box-shadow: 0 0 0 2px rgba( 22, 163, 74, 0.25 );
}

.ccm-dashboard-presence-light--yellow {
	background: #ca8a04;
	box-shadow: 0 0 0 2px rgba( 202, 138, 4, 0.25 );
}

.ccm-dashboard-presence-light--red {
	background: #dc2626;
	box-shadow: 0 0 0 2px rgba( 220, 38, 38, 0.25 );
}

.ccm-dashboard-online-you {
	flex-shrink: 0;
	font-size: 0.85em;
	color: #646970;
	font-style: italic;
	font-weight: 400;
}

.ccm-dashboard-online-current .ccm-dashboard-online-compact-btn {
	background: transparent !important;
	color: #1d2327 !important;
}

/* Versteckte HTML-Vorlagen für Dialoginhalt */
.ccm-dashboard-user-detail-sources {
	display: none !important;
}

/* —— Dialog / Bottom-Sheet —— */
.ccm-dashboard-online-dialog {
	padding: 0;
	border: none;
	max-height: none;
	background: transparent;
	width: min( 100vw - 2rem, 480px );
	margin: auto;
}

@media ( max-width: 599px ) {
	.ccm-dashboard-online-dialog {
		width: 100vw;
		max-width: 100vw;
		margin: 0;
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		top: auto;
		transform: none;
		max-height: 100vh;
	}

	.ccm-dashboard-online-dialog-sheet {
		width: 100%;
		border-radius: 14px 14px 0 0;
	}
}

.ccm-dashboard-online-dialog::backdrop {
	background: rgba( 0, 0, 0, 0.45 );
}

.ccm-dashboard-online-dialog-sheet {
	position: relative;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 8px 32px rgba( 0, 0, 0, 0.18 );
	max-height: min( 92vh, 720px );
	overflow: auto;
	padding: 0.5rem 1.25rem max( 1.35rem, env( safe-area-inset-bottom, 0px ) );
	width: min( 100vw - 2rem, 480px );
	margin: 0;
	box-sizing: border-box;
}

.ccm-dashboard-online-dialog-handle {
	width: 36px;
	height: 4px;
	border-radius: 2px;
	background: #dcdcde;
	margin: 0.35rem auto 0.75rem;
}

.ccm-dashboard-online-dialog-close {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	z-index: 2;
	width: 40px;
	height: 40px;
	padding: 0;
	border: none;
	border-radius: 8px;
	background: #f0f0f1;
	color: #1d2327;
	font-size: 1.35rem;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ccm-dashboard-online-dialog-close:hover,
.ccm-dashboard-online-dialog-close:focus-visible {
	background: #dcdcde;
}

.ccm-dashboard-online-dialog-body {
	padding: 0.35rem 0.15rem 0.5rem;
}

.ccm-dashboard-online-dialog-body .ccm-dashboard-online-card-head {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	align-items: start;
	gap: 0.85rem 1rem;
	margin-bottom: 1rem;
	padding-right: 2.25rem;
}

.ccm-dashboard-online-dialog-body .ccm-dashboard-online-card-head > img,
.ccm-dashboard-online-dialog-body .ccm-dashboard-online-card-head .avatar {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
}

.ccm-dashboard-online-dialog-body .ccm-dashboard-online-card-id {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.ccm-dashboard-online-dialog-body .ccm-dashboard-online-card-name {
	font-size: 1.1rem;
	font-weight: 700;
	color: #1d2327;
	line-height: 1.25;
}

.ccm-dashboard-online-dialog-body .ccm-dashboard-online-card-name-row {
	width: 100%;
}

.ccm-dashboard-online-dialog-body .ccm-dashboard-online-quick-icons--detail {
	flex-basis: 100%;
	justify-content: flex-start;
	gap: 0.35rem;
	margin-top: 0.15rem;
	padding: 0;
}

.ccm-dashboard-online-dialog-body .ccm-dashboard-online-profile-link {
	display: inline-block;
	font-size: 0.85rem;
	margin: 0;
	color: #2A6B6B;
	text-decoration: none;
}

.ccm-dashboard-online-dialog-body .ccm-dashboard-online-profile-link:hover {
	text-decoration: underline;
}

.ccm-dashboard-role-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-size: 0.8rem;
	font-weight: 500;
	color: var( --ccm-role-color, #475569 );
	margin: 0;
}

.ccm-dashboard-role-badge .ccm-beratung-role-svg {
	flex-shrink: 0;
	display: block;
}

.ccm-dashboard-online-meta {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0.55rem;
	margin: 0.85rem 0 0;
	padding: 0.85rem 0 0;
	border-top: 1px solid #f0f0f1;
	font-size: 0.88rem;
}

.ccm-dashboard-online-meta div {
	display: grid;
	grid-template-columns: minmax(7rem, 32%) minmax(0, 1fr);
	gap: 0.35rem 0.75rem;
	align-items: start;
}

.ccm-dashboard-online-meta dt {
	margin: 0;
	color: #646970;
	font-weight: 500;
}

.ccm-dashboard-online-meta dd {
	margin: 0;
	overflow-wrap: anywhere;
	word-break: break-word;
	color: #1d2327;
	line-height: 1.45;
}

.ccm-dashboard-online-page-link {
	color: #2A6B6B;
	text-decoration: none;
}

.ccm-dashboard-online-page-link:hover {
	text-decoration: underline;
}

.ccm-dashboard-online-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 1.1rem;
	padding-top: 0.85rem;
	border-top: 1px solid #f0f0f1;
}

.ccm-dashboard-btn--small {
	padding: 0.45rem 0.75rem;
	font-size: 0.85rem;
	line-height: 1.25;
	border: 1px solid transparent;
	cursor: pointer;
	border-radius: 6px;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	min-height: 44px;
	box-sizing: border-box;
	vertical-align: middle;
}

.ccm-dashboard-online-actions .ccm-dashboard-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1.25;
}

.ccm-dashboard-online-refresh-icon.ccm-dashboard-btn--small {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	box-sizing: border-box;
	min-width: 25px;
	width: 25px;
	min-height: 25px;
	height: 25px;
}

.ccm-dashboard-online-refresh-icon .dashicons {
	width: 16px;
	height: 16px;
	font-size: 16px;
	line-height: 1;
}

@keyframes ccm-dashboard-refresh-spin {
	to {
		transform: rotate(360deg);
	}
}

.ccm-dashboard-online-refresh.is-loading .dashicons {
	animation: ccm-dashboard-refresh-spin 0.85s linear infinite;
}

.ccm-dashboard-online-refresh:disabled {
	opacity: 0.85;
	cursor: wait;
}

.ccm-dashboard-btn--danger {
	background: #b32d2e;
	color: #fff !important;
}

.ccm-dashboard-btn--danger:hover {
	background: #8a2424;
	color: #fff !important;
}

.ccm-dashboard-btn--warn {
	background: #dba617;
	color: #1d2327 !important;
}

.ccm-dashboard-btn--warn:hover {
	background: #c49212;
}

.ccm-dashboard-btn--ghost {
	background: transparent;
	color: #2A6B6B !important;
	border: 1px solid #2A6B6B;
}

/* Desktop: Dialog mittig als „Popup“ */
@media ( min-width: 600px ) {
	.ccm-dashboard-online-dialog {
		width: min( 420px, calc( 100vw - 2rem ) );
		max-width: min( 420px, calc( 100vw - 2rem ) );
		margin: auto;
		position: fixed;
		top: 50%;
		left: 50%;
		bottom: auto;
		right: auto;
		transform: translate( -50%, -50% );
	}

	.ccm-dashboard-online-dialog-sheet {
		border-radius: 12px;
		width: 100%;
		max-height: min( 85vh, 640px );
		margin: 0;
		padding-top: 1rem;
	}

	.ccm-dashboard-online-dialog-handle {
		display: none;
	}
}

@media ( min-width: 900px ) {
	.ccm-dashboard-wrapper {
		max-width: 1400px;
	}

	.ccm-dashboard-sidebar {
		flex: 0 0 min( 100%, 340px );
	}
}

/* Metabox-Widget: Online-Liste volle Breite (ohne seitliches Box-Padding), kein Listen-Rahmen */
.ccm-dashboard-widget-body .ccm-dashboard-online-wrap {
	width: 100%;
	margin: 0;
	box-sizing: border-box;
}

.ccm-dashboard-widget-body .ccm-dashboard-online-wrap > .ccm-dashboard-empty {
	padding: 0 14px;
	margin: 0;
}

.ccm-dashboard-widget-body .ccm-dashboard-online-compact {
	width: 100%;
	margin: 0;
	border: none;
	border-radius: 0;
	overflow: visible;
	background: transparent;
}

.ccm-dashboard-widget-body .ccm-dashboard-online-compact-item {
	border-bottom: none;
}

.ccm-dashboard-widget-body .ccm-dashboard-online-compact-item:nth-child(odd) {
	background-color: #fff;
}

.ccm-dashboard-widget-body .ccm-dashboard-online-compact-item:nth-child(even) {
	background-color: #f6f7f7;
}

/* Kein extra blauer „Du“-Hintergrund — wie die übrigen Zeilen (Zebra via nth-child) */
.ccm-dashboard-widget-body .ccm-dashboard-online-compact-item.ccm-dashboard-online-current {
	background-color: transparent;
}

.ccm-dashboard-widget-body .ccm-dashboard-online-compact-item.ccm-dashboard-online-current:nth-child(odd) {
	background-color: #fff;
}

.ccm-dashboard-widget-body .ccm-dashboard-online-compact-item.ccm-dashboard-online-current:nth-child(even) {
	background-color: #f6f7f7;
}

.ccm-dashboard-widget-body .ccm-dashboard-online-current .ccm-dashboard-online-compact-btn {
	background: transparent;
	color: #1d2327;
}

.ccm-dashboard-widget-body .ccm-dashboard-online-compact-item .ccm-dashboard-online-compact-row {
	margin: 0;
	padding: 0;
	width: 100%;
}

.ccm-dashboard-widget-body .ccm-dashboard-online-compact-btn {
	padding-top: 0.7rem;
	padding-bottom: 0.7rem;
	padding-right: 14px;
	padding-left: 0.75rem;
	border-radius: 0 !important;
	background: transparent !important;
	color: #1d2327 !important;
}

.ccm-dashboard-widget-body .ccm-dashboard-online-quick-icons {
	padding-right: 12px;
	gap: 0.3rem;
}

.ccm-dashboard-widget-body .ccm-dashboard-online-compact-btn:hover,
.ccm-dashboard-widget-body .ccm-dashboard-online-compact-btn:focus-visible {
	background: transparent !important;
	color: #1d2327 !important;
	border-radius: 0 !important;
}

.ccm-dashboard-widget-body .ccm-dashboard-online-compact-item:hover,
.ccm-dashboard-widget-body .ccm-dashboard-online-compact-item:focus-within {
	background-color: rgba(42, 107, 107, 0.07);
}

.ccm-dashboard-widget-body .ccm-dashboard-online-compact-item.ccm-dashboard-online-current .ccm-dashboard-online-compact-btn:hover,
.ccm-dashboard-widget-body .ccm-dashboard-online-compact-item.ccm-dashboard-online-current .ccm-dashboard-online-compact-btn:focus-visible {
	background: transparent !important;
}

/* Online-View / kompakte Zeile */
@media (max-width: 782px) {
	.ccm-dashboard-online-compact-row {
		grid-template-columns: minmax(0, 1fr) auto;
		column-gap: 0.15rem;
	}

	.ccm-dashboard-online-compact-btn {
		min-height: 48px;
		gap: 0.35rem;
		padding: 0.45rem 0.4rem 0.45rem 0.6rem;
	}

	.ccm-dashboard-widget-body .ccm-dashboard-online-compact-btn {
		padding-right: 6px;
		padding-left: 0.55rem;
	}

	.ccm-dashboard-online-quick-icons {
		padding: 0 8px 0 0;
		gap: 0.1rem;
	}

	.ccm-dashboard-online-compact-chevron {
		display: none;
	}

	.ccm-dashboard-online-icon-link {
		width: 36px;
		height: 36px;
		min-width: 36px;
		min-height: 36px;
	}

	.ccm-dashboard-online-icon-link .dashicons {
		font-size: 18px;
		width: 18px;
		height: 18px;
	}

	.ccm-dashboard-online-compact-login {
		font-size: 0.9rem;
	}

	.ccm-dashboard-team-badge {
		font-size: 0.62rem;
		padding: 0.1rem 0.3rem;
	}
}

@media (max-width: 480px) {
	.ccm-dashboard-online-compact-row {
		grid-template-columns: minmax(0, 1fr) auto;
	}

	.ccm-dashboard-online-icon-link {
		width: 34px;
		height: 34px;
		min-width: 34px;
		min-height: 34px;
	}

	.ccm-dashboard-online-quick-icons {
		padding-right: 6px;
	}
}