/**
 * Design v3 — typography, icons, modern panel chrome (2.4.0)
 */

:root {
	--hm-font: "Rubik", "Heebo", "Segoe UI", Tahoma, Arial, sans-serif;
	--hm-font-display: "Heebo", "Rubik", sans-serif;
	--hm-bg: #eef2f7;
	--hm-surface: #ffffff;
	--hm-border: #dbe3ef;
	--hm-text: #0c1222;
	--hm-muted: #5c6b82;
	--hm-primary: #2563eb;
	--hm-primary-hover: #1d4ed8;
	--hm-accent: #06b6d4;
	--hm-sidebar: linear-gradient(180deg, #0b1220 0%, #111827 55%, #0f172a 100%);
	--hm-sidebar-solid: #0f172a;
	--hm-radius: 16px;
	--hm-radius-sm: 10px;
	--hm-shadow: 0 4px 24px rgb(15 23 42 / 6%);
	--hm-shadow-lg: 0 12px 40px rgb(15 23 42 / 10%);
	--hm-panel-icon-size: 48px;
	--hm-text-lg: 1.125rem;
	--hm-text-xl: 1.375rem;
	--hm-text-2xl: 1.625rem;
	--hm-gradient-brand: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
	--hm-gradient-warm: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
	--hm-gradient-cool: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
	--hm-gradient-green: linear-gradient(135deg, #059669 0%, #10b981 100%);
	--hm-gradient-teal: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
}

html {
	font-size: 18px;
}

body.ha-merechet {
	font-family: var(--hm-font);
	letter-spacing: -0.01em;
	background: var(--hm-bg);
	background-image:
		radial-gradient(ellipse 80% 50% at 100% 0%, rgb(37 99 235 / 6%), transparent),
		radial-gradient(ellipse 60% 40% at 0% 100%, rgb(6 182 212 / 5%), transparent);
}

/* Icons */
.hm-icon svg {
	display: block;
	width: 100%;
	height: 100%;
}

/* App shell */
.hm-app {
	grid-template-columns: 212px 1fr;
	align-items: start;
}

.hm-sidebar {
	background: var(--hm-sidebar-solid);
	background-image: var(--hm-sidebar);
	color: #e2e8f0;
	padding: 1.125rem 0.75rem;
	border-inline-start: 1px solid rgb(255 255 255 / 6%);
	position: sticky;
	top: 0;
	height: 100vh;
	max-height: 100vh;
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: rgb(255 255 255 / 20%) transparent;
}

.hm-sidebar__brand {
	gap: 0.45rem;
	font-family: var(--hm-font-display);
	font-size: 0.833rem;
	font-weight: 600;
	margin-bottom: 1rem;
	padding: 0.25rem 0.5rem;
}

.hm-sidebar--institution .hm-sidebar__role {
	font-size: 0.78rem;
	font-weight: 600;
	color: rgb(226 232 240 / 80%);
}

.hm-sidebar__brand .hm-brand-icon,
.hm-sidebar__brand .hm-icon {
	width: 32px;
	height: 32px;
	padding: 5px;
	border-radius: 8px;
	flex-shrink: 0;
}

.hm-sidebar__brand .hm-icon {
	background: var(--hm-gradient-brand);
	color: #fff;
}

.hm-brand-icon {
	display: block;
	border-radius: 10px;
	object-fit: contain;
	flex-shrink: 0;
	box-shadow: 0 4px 14px rgb(15 23 42 / 12%);
}

.hm-brand-icon--topbar,
.hm-topbar__icon.hm-brand-icon {
	width: 52px;
	height: 52px;
	padding: 0;
	border-radius: 14px;
	background: transparent;
	box-shadow: 0 4px 16px rgb(37 99 235 / 20%);
}

.hm-brand-icon--gate {
	width: 64px;
	height: 64px;
	border-radius: 18px;
	box-shadow: 0 8px 24px rgb(37 99 235 / 25%);
}

.hm-topbar__icon {
	width: 52px;
	height: 52px;
	padding: 12px;
	border-radius: 14px;
	background: var(--hm-gradient-brand);
	color: #fff;
	flex-shrink: 0;
	box-shadow: 0 4px 16px rgb(37 99 235 / 25%);
}

.hm-brand__mark {
	display: none;
}

.hm-nav {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
	flex: 1;
}

.hm-nav__link {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.833rem;
	font-weight: 500;
	padding: 0.5625rem 0.625rem;
	border-radius: var(--hm-radius-sm);
	color: inherit;
	text-decoration: none;
	transition: background 0.15s ease, transform 0.15s ease;
}

.hm-sidebar .hm-nav__link--panel {
	appearance: none;
	width: 100%;
	text-align: inherit;
	border: none;
	background: transparent;
	cursor: pointer;
	font: inherit;
	color: inherit;
}

.hm-sidebar .hm-nav__section {
	display: block;
	padding: 0.75rem 0.625rem 0.35rem;
	font-size: 0.68rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: rgb(148 163 184 / 85%);
}

.hm-sidebar .hm-sidebar__role,
.hm-sidebar .hm-sidebar__foot .hm-muted {
	color: rgb(226 232 240 / 70%);
}

.hm-nav__link .hm-icon {
	width: 18px;
	height: 18px;
	opacity: 0.75;
	flex-shrink: 0;
}

.hm-nav__link:hover,
.hm-nav__link--active {
	background: rgb(255 255 255 / 12%);
	transform: translateX(-2px);
}

.hm-nav__link--active {
	box-shadow: inset 3px 0 0 var(--hm-accent);
}

.hm-nav__link--active .hm-icon {
	opacity: 1;
	color: var(--hm-accent);
}

.hm-nav__link--accent .hm-icon {
	opacity: 0.95;
	color: #67e8f9;
}

.hm-sidebar__foot {
	padding-top: 1rem;
	font-size: 0.833rem;
}

.hm-sidebar__foot .hm-nav__link--small {
	font-size: 0.833rem;
}

/* Topbar */
.hm-topbar {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	align-items: center;
	gap: 0.75rem 1rem;
	padding: 0.75rem 1.25rem;
	background: rgb(255 255 255 / 85%);
	backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--hm-border);
}

.hm-topbar--compact {
	padding: 0.625rem 1.25rem;
}

.hm-topbar--compact .hm-topbar__main {
	gap: 0.65rem;
}

.hm-topbar--compact .hm-topbar__title {
	font-size: 1.125rem;
	margin: 0;
	line-height: 1.2;
}

.hm-topbar--compact .hm-brand-icon--topbar,
.hm-topbar--compact .hm-topbar__icon.hm-brand-icon {
	width: 40px;
	height: 40px;
	border-radius: 11px;
}

.hm-topbar--compact .hm-pulse-tile {
	min-width: 96px;
	max-width: 132px;
	padding: 0.4rem 0.6rem;
}

.hm-topbar--with-nav {
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
}

.hm-topbar__actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	flex-shrink: 0;
}

.hm-topbar-support-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.45rem 0.9rem;
	border-radius: 999px;
	border: 1px solid #ffdcd9;
	background: #fff1f0;
	color: #e74c3c;
	font: inherit;
	font-size: 0.78rem;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
	white-space: nowrap;
}

.hm-topbar-support-btn .hm-icon {
	width: 16px;
	height: 16px;
}

.hm-topbar-support-btn:hover {
	background: #ffe6e4;
	transform: translateY(-1px);
	box-shadow: 0 2px 5px rgb(231 76 60 / 15%);
}

.hm-topbar__nav {
	display: flex;
	align-items: stretch;
	justify-content: center;
	gap: 0.25rem;
	min-width: 0;
	overflow-x: auto;
	padding: 0 0.15rem;
	scrollbar-width: thin;
}

.hm-topnav-item {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.2rem;
	min-width: 4.5rem;
	padding: 0.35rem 0.5rem;
	border: 1px solid transparent;
	border-radius: 12px;
	background: transparent;
	cursor: pointer;
	font: inherit;
	color: var(--hm-muted);
	position: relative;
	flex-shrink: 0;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.hm-topnav-item:hover {
	background: rgb(37 99 235 / 6%);
	color: var(--hm-text);
	border-color: rgb(37 99 235 / 18%);
}

.hm-topnav-item--active {
	background: rgb(37 99 235 / 10%);
	color: var(--hm-primary);
	border-color: rgb(37 99 235 / 28%);
}

.hm-topnav-item__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 10px;
	color: #fff;
}

.hm-topnav-item__icon .hm-icon {
	width: 16px;
	height: 16px;
}

.hm-topnav-item--heatmap .hm-topnav-item__icon { background: var(--hm-gradient-brand); }
.hm-topnav-item--cube .hm-topnav-item__icon { background: var(--hm-gradient-cool); }
.hm-topnav-item--context .hm-topnav-item__icon { background: var(--hm-gradient-teal); }
.hm-topnav-item--briefing .hm-topnav-item__icon { background: var(--hm-gradient-warm); }
.hm-topnav-item--chat .hm-topnav-item__icon { background: linear-gradient(135deg, #dc2626 0%, #f97316 100%); }
.hm-topnav-item--wa .hm-topnav-item__icon { background: var(--hm-gradient-green); }

.hm-topnav-item__label {
	font-size: 0.65rem;
	font-weight: 700;
	line-height: 1.15;
	text-align: center;
	white-space: nowrap;
}

.hm-topnav-item__badge {
	position: absolute;
	top: 2px;
	inset-inline-start: 2px;
	min-width: 1rem;
	height: 1rem;
	padding: 0 0.2rem;
	border-radius: 999px;
	background: #f59e0b;
	color: #fff;
	font-size: 0.6rem;
	font-weight: 800;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.hm-topnav-item__badge--alert {
	background: #dc2626;
}

.hm-topbar__hub {
	display: flex;
	justify-content: center;
	align-items: stretch;
	min-width: 0;
	padding: 0 0.25rem;
}

.hm-pulse-row {
	display: flex;
	flex-wrap: nowrap;
	align-items: stretch;
	justify-content: center;
	gap: 0.5rem;
	max-width: 100%;
	overflow-x: auto;
	padding: 2px 4px;
	scrollbar-width: thin;
}

.hm-pulse-row::-webkit-scrollbar {
	height: 4px;
}

.hm-pulse-row::-webkit-scrollbar-thumb {
	background: rgb(15 23 42 / 15%);
	border-radius: 999px;
}

.hm-pulse-tile {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	gap: 0.08rem;
	min-width: 108px;
	max-width: 148px;
	padding: 0.5rem 0.72rem;
	border-radius: 12px;
	border: 1px solid var(--hm-border);
	background: rgb(255 255 255 / 95%);
	cursor: pointer;
	text-align: start;
	font: inherit;
	color: inherit;
	flex-shrink: 0;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.hm-pulse-tile:hover {
	border-color: rgb(37 99 235 / 45%);
	box-shadow: 0 4px 14px rgb(37 99 235 / 12%);
	transform: translateY(-1px);
}

.hm-pulse-tile:focus-visible {
	outline: 2px solid var(--hm-accent);
	outline-offset: 2px;
}

.hm-pulse-tile:active {
	transform: translateY(0);
}

.hm-pulse-tile__kicker {
	font-size: 0.667rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	color: var(--hm-muted);
	line-height: 1.2;
}

.hm-pulse-tile__value {
	font-family: var(--hm-font-display);
	font-size: 1.2rem;
	font-weight: 700;
	line-height: 1.05;
	color: var(--hm-text);
}

.hm-pulse-tile__title {
	font-size: 0.833rem;
	font-weight: 700;
	line-height: 1.2;
	max-width: 132px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.hm-pulse-tile__sub,
.hm-pulse-tile__hint {
	font-size: 0.694rem;
	line-height: 1.25;
	color: var(--hm-muted);
	max-width: 132px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.hm-pulse-tile--meta {
	min-width: 148px;
	max-width: 168px;
	background: linear-gradient(135deg, rgb(239 246 255 / 95%), rgb(255 255 255 / 98%));
	border-color: rgb(191 219 254 / 70%);
}

.hm-pulse-tile--meta .hm-pulse-tile__title {
	max-width: 152px;
	white-space: normal;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.hm-pulse-tile--stat .hm-pulse-tile__value {
	color: var(--hm-accent);
}

.hm-pulse-tile--ok {
	background: rgb(240 253 244 / 95%);
	border-color: rgb(134 239 172 / 55%);
}

.hm-pulse-tile--ok .hm-pulse-tile__value {
	color: #15803d;
}

.hm-pulse-tile--warn {
	background: rgb(255 251 235 / 96%);
	border-color: rgb(252 211 77 / 55%);
}

.hm-pulse-tile--warn .hm-pulse-tile__value {
	color: #b45309;
}

.hm-pulse-tile--critical {
	background: rgb(254 242 242 / 96%);
	border-color: rgb(252 165 165 / 55%);
}

.hm-pulse-tile--critical .hm-pulse-tile__value {
	color: #b91c1c;
}

.hm-pulse-tile--info {
	background: rgb(239 246 255 / 96%);
	border-color: rgb(147 197 253 / 55%);
}

.hm-pulse-tile--info .hm-pulse-tile__value {
	color: #1d4ed8;
}

.hm-pulse-tile--active {
	border-color: var(--hm-accent);
	box-shadow: 0 0 0 2px rgb(37 99 235 / 20%);
}

.hm-pulse-tile--pop {
	animation: hm-pulse-pop 0.65s ease 2;
}

@keyframes hm-pulse-pop {
	0%,
	100% {
		transform: scale(1);
	}

	40% {
		transform: scale(1.06);
		box-shadow: 0 0 0 4px rgb(220 38 38 / 25%);
	}
}

.hm-live-toasts {
	position: fixed;
	top: 5.5rem;
	left: 1.25rem;
	z-index: 200;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	max-width: 340px;
	pointer-events: none;
}

.hm-live-toast {
	pointer-events: auto;
	background: rgb(255 255 255 / 98%);
	border: 1px solid var(--hm-border);
	border-right: 4px solid var(--hm-accent);
	border-radius: 14px;
	padding: 0.75rem 2rem 0.75rem 0.85rem;
	box-shadow: 0 14px 36px rgb(15 23 42 / 16%);
	opacity: 0;
	transform: translateY(-10px) scale(0.97);
	transition: opacity 0.25s ease, transform 0.25s ease;
	cursor: pointer;
	position: relative;
}

.hm-live-toast--in {
	opacity: 1;
	transform: translateY(0) scale(1);
}

.hm-live-toast--out {
	opacity: 0;
	transform: translateY(-6px);
}

.hm-live-toast--critical {
	border-right-color: #dc2626;
}

.hm-live-toast--warn {
	border-right-color: #d97706;
}

.hm-live-toast--info {
	border-right-color: #2563eb;
}

.hm-live-toast--ok {
	border-right-color: #16a34a;
}

.hm-live-toast__title {
	display: block;
	font-size: 0.9rem;
	font-weight: 700;
	margin-bottom: 0.15rem;
}

.hm-live-toast__body {
	margin: 0;
	font-size: 0.8125rem;
	color: var(--hm-muted);
}

.hm-live-toast__close {
	position: absolute;
	top: 0.35rem;
	left: 0.35rem;
	border: 0;
	background: transparent;
	font-size: 1.1rem;
	line-height: 1;
	cursor: pointer;
	color: var(--hm-muted);
}

.hm-pulse-highlight {
	animation: hm-pulse-flash 1.1s ease;
}

@keyframes hm-pulse-flash {
	0%,
	100% {
		box-shadow: none;
	}

	35% {
		box-shadow: 0 0 0 3px rgb(37 99 235 / 35%);
	}
}

.hm-topbar__hub[data-summary='critical'] .hm-pulse-tile--meta {
	border-color: rgb(252 165 165 / 55%);
}

@media (max-width: 960px) {
	.hm-topbar {
		grid-template-columns: 1fr;
		justify-items: stretch;
	}

	.hm-topbar__hub {
		order: 2;
		padding: 0.35rem 0 0.15rem;
		border-top: 1px solid var(--hm-border);
	}

	.hm-pulse-row {
		justify-content: flex-start;
	}
}

.hm-topbar__main {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.hm-topbar__icon {
	width: 52px;
	height: 52px;
	padding: 12px;
	border-radius: 14px;
	background: var(--hm-gradient-brand);
	color: #fff;
	flex-shrink: 0;
	box-shadow: 0 4px 16px rgb(37 99 235 / 25%);
}

.hm-topbar__title {
	font-family: var(--hm-font-display);
	font-size: var(--hm-text-2xl);
	font-weight: 700;
	letter-spacing: -0.02em;
}

.hm-topbar__sub {
	font-size: var(--hm-text-lg);
	margin-top: 0.125rem;
}

.hm-status {
	font-size: 0.944rem;
	font-weight: 500;
	padding: 0.5rem 0.875rem;
	background: rgb(15 23 42 / 4%);
	border-radius: 999px;
}

.hm-status__dot {
	width: 10px;
	height: 10px;
	box-shadow: 0 0 0 3px rgb(22 163 74 / 20%);
}

/* Dashboard grid */
.hm-dashboard {
	padding: 1.75rem;
	overflow: visible;
	flex: 1;
}

.hm-dash-foot {
	padding: 0.5rem 1.25rem 0.75rem;
	border-top: 1px solid var(--hm-border);
	background: rgb(255 255 255 / 60%);
}

.hm-dash-foot__status {
	font-size: 0.75rem;
	font-weight: 500;
	padding: 0.35rem 0.65rem;
	background: rgb(15 23 42 / 4%);
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
}

.hm-dashboard__grid {
	gap: 1.25rem;
	overflow: visible;
}

/* דף בית — רק כרטיסיות גישה מהירה */
.hm-dashboard--home {
	grid-template-columns: 1fr !important;
	grid-template-rows: auto !important;
}

/* דף בית בלבד — כרטיסיות גישה מהירה; בדפי נושא מוסתר לגמרי */
#hm-dashboard-root:not([data-view="operational"]) #hm-dashboard-operational,
#hm-dashboard-operational[hidden] {
	display: none !important;
}

/* דפי נושא — מסך מלא לכל פריט בתפריט */
#hm-dashboard-root > .hm-panel--page[hidden] {
	display: none !important;
}

#hm-dashboard-root > .hm-panel--page:not([hidden]) {
	min-height: calc(100vh - 108px);
}

.hm-schedule-stack--page {
	grid-column: unset;
	grid-row: unset;
	margin-top: 0;
}

.hm-dashboard__grid > .hm-panel--briefing,
.hm-dashboard__grid > .hm-panel--admin-chat,
.hm-dashboard__grid > #hm-calendar-sensitivity-panel,
.hm-dashboard__grid > #hm-wa-activity-root,
.hm-dashboard__grid > #hm-proactive-ops-root {
	grid-column: 2;
	min-width: 0;
}

.hm-dashboard__grid > .hm-panel--briefing .hm-panel__head,
.hm-dashboard__grid > .hm-panel--admin-chat .hm-panel__head,
.hm-dashboard__grid > #hm-calendar-sensitivity-panel .hm-panel__head,
.hm-dashboard__grid > #hm-wa-activity-root .hm-panel__head,
.hm-dashboard__grid > #hm-proactive-ops-root .hm-panel__head {
	flex-direction: column;
	align-items: stretch;
	gap: 0.75rem;
}

.hm-dashboard__grid > .hm-panel--briefing .hm-panel__head-main,
.hm-dashboard__grid > .hm-panel--admin-chat .hm-panel__head-main,
.hm-dashboard__grid > #hm-calendar-sensitivity-panel .hm-panel__head-main,
.hm-dashboard__grid > #hm-wa-activity-root .hm-panel__head-main,
.hm-dashboard__grid > #hm-proactive-ops-root .hm-panel__head-main {
	width: 100%;
}

.hm-dashboard__grid > .hm-panel--briefing .hm-panel__actions,
.hm-dashboard__grid > .hm-panel--admin-chat .hm-panel__actions,
.hm-dashboard__grid > #hm-calendar-sensitivity-panel .hm-panel__actions,
.hm-dashboard__grid > #hm-wa-activity-root .hm-panel__actions,
.hm-dashboard__grid > #hm-proactive-ops-root .hm-panel__actions {
	width: 100%;
	justify-content: flex-start;
}

.hm-briefing-head__tools {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.45rem;
}

/* ── דף בית דשבורד ─────────────────────────────────────────────────────── */

.hm-dash-home-layout {
	display: flex;
	flex-direction: column;
	gap: 1.1rem;
	width: 100%;
}

.hm-dash-section--pulse {
	position: relative;
	padding-top: 2.75rem;
}

.hm-dash-mascot {
	position: absolute;
	top: 0;
	left: 50%;
	z-index: 6;
	pointer-events: none;
	line-height: 0;
	transform: translate(-50%, -42%);
	filter: drop-shadow(0 8px 18px rgb(15 23 42 / 16%));
}

.hm-dash-mascot__img {
	width: auto;
	height: 108px;
	max-width: 120px;
	object-fit: contain;
	object-position: bottom center;
}

.hm-dash-section--pulse .hm-topbar__hub {
	width: 100%;
	padding: 0;
}

.hm-dash-section--pulse .hm-pulse-row {
	justify-content: flex-start;
	flex-wrap: wrap;
	overflow: visible;
}

.hm-dash-section--pulse .hm-pulse-tile {
	min-width: 118px;
	max-width: 155px;
}

.hm-dash-section__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1rem;
	margin-bottom: 0.85rem;
}

.hm-dash-section__head--flat {
	margin-bottom: 0.65rem;
}

.hm-dash-section__head-main {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	flex: 1;
	min-width: 0;
}

.hm-dash-section__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border-radius: 12px;
	color: #fff;
	flex-shrink: 0;
}

.hm-dash-section__icon--insights {
	background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

.hm-dash-section__icon .hm-icon {
	width: 20px;
	height: 20px;
}

.hm-dash-section__title {
	margin: 0;
	font-family: var(--hm-font-display);
	font-size: 1.15rem;
	font-weight: 700;
}

.hm-dash-section__sub {
	margin: 0.15rem 0 0;
	font-size: 0.78rem;
	color: var(--hm-muted);
}

.hm-dash-section--insights {
	padding: 1.1rem 1.25rem;
}

.hm-insights-score {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-width: 3.5rem;
	padding: 0.35rem 0.55rem;
	border-radius: 12px;
	background: rgb(99 102 241 / 8%);
	border: 1px solid rgb(99 102 241 / 20%);
}

.hm-insights-score--ok { border-color: rgb(16 185 129 / 35%); background: rgb(16 185 129 / 8%); }
.hm-insights-score--warn { border-color: rgb(245 158 11 / 35%); background: rgb(245 158 11 / 8%); }
.hm-insights-score--alert { border-color: rgb(239 68 68 / 35%); background: rgb(239 68 68 / 8%); }

.hm-insights-score__value {
	font-size: 1.35rem;
	font-weight: 800;
	line-height: 1;
}

.hm-insights-score__label {
	font-size: 0.65rem;
	color: var(--hm-muted);
	font-weight: 700;
}

.hm-insights-kpis {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0.65rem;
	margin-bottom: 0.85rem;
}

.hm-insights-kpi {
	padding: 0.65rem 0.75rem;
	border-radius: 12px;
	border: 1px solid var(--hm-border);
	background: rgb(15 23 42 / 2%);
	text-align: center;
}

.hm-insights-kpi__value {
	display: block;
	font-size: 1.25rem;
	font-weight: 800;
	line-height: 1.1;
}

.hm-insights-kpi__label {
	font-size: 0.72rem;
	color: var(--hm-muted);
	font-weight: 600;
}

.hm-insights-kpi--critical .hm-insights-kpi__value { color: #dc2626; }
.hm-insights-kpi--warn .hm-insights-kpi__value { color: #d97706; }
.hm-insights-kpi--idea .hm-insights-kpi__value { color: #0891b2; }

.hm-insights-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
}

.hm-insights-list__item {
	display: flex;
	align-items: flex-start;
	gap: 0.55rem;
	padding: 0.55rem 0.65rem;
	border-radius: 10px;
	border: 1px solid var(--hm-border);
	background: var(--hm-surface);
}

.hm-insights-list__badge {
	flex-shrink: 0;
	font-size: 0.62rem;
	font-weight: 800;
	padding: 0.15rem 0.45rem;
	border-radius: 999px;
	background: rgb(15 23 42 / 6%);
	color: var(--hm-muted);
}

.hm-insights-list__item--critical .hm-insights-list__badge { background: #fee2e2; color: #991b1b; }
.hm-insights-list__item--warn .hm-insights-list__badge { background: #fef3c7; color: #92400e; }
.hm-insights-list__item--idea .hm-insights-list__badge { background: #cffafe; color: #155e75; }

.hm-insights-list__text {
	font-size: 0.82rem;
	line-height: 1.35;
}

.hm-dash-mini-stats {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.hm-dash-mini-stat {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 0.4rem 0.7rem;
	border-radius: 10px;
	border: 1px solid var(--hm-border);
	background: var(--hm-surface);
	min-width: 4.5rem;
}

.hm-dash-mini-stat__value {
	font-size: 1rem;
	font-weight: 800;
	line-height: 1.1;
}

.hm-dash-mini-stat__label {
	font-size: 0.65rem;
	color: var(--hm-muted);
	font-weight: 600;
}

.hm-dash-mini-stat--warn .hm-dash-mini-stat__value {
	color: #d97706;
}

.hm-dash-charts-grid {
	display: grid;
	grid-template-columns: 1.2fr 1.2fr 0.8fr;
	gap: 0.85rem;
}

.hm-dash-chart {
	padding: 1rem 1.1rem;
}

.hm-dash-chart__title {
	margin: 0 0 0.75rem;
	font-size: 0.92rem;
	font-weight: 700;
}

.hm-bar-chart {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 0.35rem;
	min-height: 150px;
	padding-top: 0.25rem;
}

.hm-bar-chart__col {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.2rem;
}

.hm-bar-chart__bar-wrap {
	width: 100%;
	height: 110px;
	display: flex;
	align-items: flex-end;
	justify-content: center;
}

.hm-bar-chart__bar {
	width: 72%;
	max-width: 2.4rem;
	border-radius: 8px 8px 4px 4px;
	background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
	position: relative;
	min-height: 4px;
	transition: height 0.25s ease;
}

.hm-bar-chart__bar--slots {
	background: linear-gradient(180deg, #6ee7b7 0%, #059669 100%);
}

.hm-bar-chart__bar-pending {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	border-radius: 0 0 4px 4px;
	background: linear-gradient(180deg, #fcd34d 0%, #f59e0b 100%);
}

.hm-bar-chart__value {
	font-size: 0.72rem;
	font-weight: 800;
	color: var(--hm-text);
}

.hm-bar-chart__label {
	font-size: 0.78rem;
	font-weight: 700;
}

.hm-bar-chart__date,
.hm-bar-chart__gap {
	font-size: 0.62rem;
	color: var(--hm-muted);
}

.hm-dash-chart__legend {
	display: flex;
	flex-wrap: wrap;
	gap: 0.65rem 1rem;
	margin: 0.65rem 0 0;
	font-size: 0.72rem;
	color: var(--hm-muted);
}

.hm-dash-chart__swatch {
	display: inline-block;
	width: 0.75rem;
	height: 0.75rem;
	border-radius: 3px;
	margin-inline-end: 0.25rem;
	vertical-align: middle;
}

.hm-dash-chart__swatch--main { background: #2563eb; }
.hm-dash-chart__swatch--pending { background: #f59e0b; }

.hm-dash-summary-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
}

.hm-dash-summary-list li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.45rem 0;
	border-bottom: 1px solid var(--hm-border);
}

.hm-dash-summary-list li:last-child {
	border-bottom: none;
}

.hm-dash-summary-list__label {
	font-size: 0.8rem;
	color: var(--hm-muted);
}

.hm-dash-summary-list__warn { color: #d97706; }
.hm-dash-summary-list__alert { color: #dc2626; }

@media (max-width: 1100px) {
	.hm-dash-charts-grid {
		grid-template-columns: 1fr 1fr;
	}

	.hm-dash-chart--summary {
		grid-column: 1 / -1;
	}
}

@media (max-width: 720px) {
	.hm-topbar--with-nav {
		grid-template-columns: 1fr;
	}

	.hm-topbar__actions {
		justify-content: flex-start;
	}

	.hm-topbar__nav {
		justify-content: flex-start;
	}

	.hm-dash-charts-grid,
	.hm-insights-kpis {
		grid-template-columns: 1fr;
	}
}

/* Quick nav strip — legacy cards */
.hm-dash-home {
	grid-column: 1 / -1;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
	gap: 0.65rem;
	margin-bottom: 0.15rem;
}

.hm-dash-card {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	padding: 0.75rem 0.875rem;
	border: 1px solid var(--hm-border);
	border-radius: var(--hm-radius-sm);
	background: var(--hm-surface);
	box-shadow: var(--hm-shadow);
	cursor: pointer;
	text-align: inherit;
	font: inherit;
	color: inherit;
	position: relative;
	transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

a.hm-dash-card {
	text-decoration: none;
}

.hm-dash-card:hover {
	transform: translateY(-2px);
	box-shadow: var(--hm-shadow-lg);
	border-color: rgb(37 99 235 / 35%);
}

.hm-dash-card__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 10px;
	color: #fff;
	flex-shrink: 0;
}

.hm-dash-card__icon .hm-icon {
	width: 18px;
	height: 18px;
}

.hm-dash-card--heatmap .hm-dash-card__icon { background: var(--hm-gradient-brand); }
.hm-dash-card--insights .hm-dash-card__icon { background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%); }
.hm-dash-card--cube .hm-dash-card__icon { background: var(--hm-gradient-cool); }
.hm-dash-card--context .hm-dash-card__icon { background: var(--hm-gradient-teal); }
.hm-dash-card--briefing .hm-dash-card__icon { background: var(--hm-gradient-warm); }
.hm-dash-card--chat .hm-dash-card__icon { background: linear-gradient(135deg, #dc2626 0%, #f97316 100%); }
.hm-dash-card--wa .hm-dash-card__icon { background: var(--hm-gradient-green); }

.hm-dash-card--insights.hm-dash-card--alert { border-color: rgb(239 68 68 / 45%); }
.hm-dash-card--insights.hm-dash-card--warn { border-color: rgb(245 158 11 / 40%); }
.hm-dash-card--insights.hm-dash-card--ok { border-color: rgb(16 185 129 / 35%); }

.hm-dash-card__score {
	margin-inline-start: auto;
	flex-shrink: 0;
	align-self: center;
	min-width: 2.1rem;
	height: 2.1rem;
	padding: 0 0.4rem;
	border-radius: 999px;
	background: var(--hm-primary);
	color: #fff;
	font-size: 0.78rem;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.hm-dash-card__score--ok { background: #059669; }
.hm-dash-card__score--warn { background: #d97706; }
.hm-dash-card__score--alert { background: #dc2626; }
.hm-dash-card__score--empty { background: #94a3b8; }

.hm-dash-card__body {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	min-width: 0;
}

.hm-dash-card__title {
	font-size: 0.833rem;
	font-weight: 700;
	line-height: 1.25;
}

.hm-dash-card__meta {
	font-size: 0.722rem;
	color: var(--hm-muted);
	line-height: 1.3;
}

.hm-dash-card__badge {
	position: absolute;
	top: 0.45rem;
	left: 0.45rem;
	min-width: 1.25rem;
	height: 1.25rem;
	padding: 0 0.35rem;
	border-radius: 999px;
	background: var(--hm-primary);
	color: #fff;
	font-size: 0.68rem;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
}

.hm-dash-card__badge--alert {
	background: #dc2626;
}

.hm-panel[id],
#hm-heatmap-root {
	scroll-margin-top: 1.25rem;
}

/* Schedule mascot — sits on Heatmap window */
.hm-schedule-stack {
	position: relative;
	grid-column: 1;
	grid-row: 2 / span 2;
	margin-top: 2.75rem;
}

.hm-schedule-mascot {
	position: absolute;
	top: 0;
	left: 50%;
	z-index: 10;
	pointer-events: none;
	line-height: 0;
	transform: translate(-50%, -52%);
}

.hm-schedule-mascot img {
	width: clamp(96px, 10vw, 148px);
	height: auto;
	max-height: 148px;
	object-fit: contain;
	object-position: bottom center;
	filter: drop-shadow(0 8px 18px rgb(15 23 42 / 16%));
}

.hm-panel--schedule {
	position: relative;
	z-index: 2;
	overflow: visible;
	padding-top: 1.625rem;
	border-top: 3px solid rgb(37 99 235 / 25%);
}

.hm-panel--schedule::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	border-radius: var(--hm-radius) var(--hm-radius) 0 0;
	background: linear-gradient(90deg, #2563eb 0%, #06b6d4 50%, #2563eb 100%);
	opacity: 0.85;
	pointer-events: none;
}

/* Panels */
.hm-panel {
	padding: 1.375rem 1.5rem;
	border-radius: var(--hm-radius);
	box-shadow: var(--hm-shadow);
	transition: box-shadow 0.2s ease;
}

.hm-panel:hover {
	box-shadow: var(--hm-shadow-lg);
}

.hm-panel__head {
	align-items: flex-start;
	margin-bottom: 1.25rem;
	padding-bottom: 1rem;
	border-bottom: 1px solid var(--hm-border);
}

.hm-panel__head-main {
	display: flex;
	align-items: flex-start;
	gap: 1rem;
	min-width: 0;
	flex: 1;
}

.hm-panel__head-text {
	min-width: 0;
}

.hm-panel__icon {
	width: var(--hm-panel-icon-size);
	height: var(--hm-panel-icon-size);
	padding: 11px;
	border-radius: 14px;
	color: #fff;
	flex-shrink: 0;
	box-shadow: 0 4px 14px rgb(15 23 42 / 12%);
}

.hm-panel__icon--demo { background: var(--hm-gradient-warm); }
.hm-panel__icon--heatmap { background: var(--hm-gradient-brand); }
.hm-panel__icon--briefing { background: var(--hm-gradient-cool); }
.hm-panel__icon--admin-chat { background: linear-gradient(135deg, #dc2626 0%, #f97316 100%); }
.hm-panel__icon--constraints { background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%); }
.hm-panel__icon--wa { background: var(--hm-gradient-green); }
.hm-panel__icon--ops { background: linear-gradient(135deg, #ea580c 0%, #f59e0b 100%); }
.hm-panel__icon--studio { background: var(--hm-gradient-teal); }
.hm-panel__icon--audit { background: linear-gradient(135deg, #475569 0%, #64748b 100%); }
.hm-panel__icon--teacher-card { background: linear-gradient(135deg, #0891b2 0%, #2563eb 100%); }

.hm-panel__title {
	font-family: var(--hm-font-display);
	font-size: var(--hm-text-xl);
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.25;
}

.hm-panel__subtitle {
	margin: 0.25rem 0 0;
	font-size: 0.944rem;
	color: var(--hm-muted);
	line-height: 1.4;
	word-break: normal;
	overflow-wrap: break-word;
}

.hm-panel__actions {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem;
	flex-shrink: 0;
}

/* Buttons & badges */
.hm-btn {
	font-size: 0.944rem;
	font-weight: 600;
	padding: 0.625rem 1.125rem;
	border-radius: var(--hm-radius-sm);
}

.hm-btn--primary {
	background: var(--hm-gradient-brand);
	border: none;
	box-shadow: 0 4px 14px rgb(37 99 235 / 30%);
}

.hm-btn--primary:hover {
	filter: brightness(1.05);
	color: #fff;
}

.hm-badge {
	font-size: 0.722rem;
	font-weight: 700;
	padding: 0.35rem 0.65rem;
	border-radius: 999px;
	letter-spacing: 0.04em;
}

/* Gate login */
.hm-card--center {
	padding: 2.5rem 2rem;
	border-radius: var(--hm-radius);
	box-shadow: var(--hm-shadow-lg);
}

.hm-card--center .hm-brand {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 1rem;
}

.hm-card--center .hm-brand .hm-icon {
	width: 64px;
	height: 64px;
	padding: 14px;
	border-radius: 18px;
	background: var(--hm-gradient-brand);
	color: #fff;
	box-shadow: 0 8px 24px rgb(37 99 235 / 30%);
}

.hm-brand__title {
	font-family: var(--hm-font-display);
	font-size: 2rem;
	font-weight: 800;
}

.hm-card--center .hm-muted {
	font-size: var(--hm-text-lg);
	margin-bottom: 1.5rem;
}

/* Drawers */
.hm-drawer__head,
.hm-tcard-drawer__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.25rem 1.5rem;
	border-bottom: 1px solid var(--hm-border);
	background: rgb(255 255 255 / 95%);
}

.hm-drawer__head-main {
	display: flex;
	align-items: flex-start;
	gap: 0.875rem;
}

.hm-drawer__icon {
	width: 44px;
	height: 44px;
	padding: 10px;
	border-radius: 12px;
	color: #fff;
	flex-shrink: 0;
}

.hm-drawer__icon--slot { background: var(--hm-gradient-brand); }
.hm-drawer__icon--teacher-card { background: linear-gradient(135deg, #0891b2 0%, #2563eb 100%); }

.hm-drawer__title,
.hm-tcard-drawer__title {
	font-family: var(--hm-font-display);
	font-size: var(--hm-text-xl);
	font-weight: 700;
	margin: 0;
}

.hm-drawer__subtitle {
	margin: 0.2rem 0 0;
	font-size: 0.944rem;
	color: var(--hm-muted);
}

.hm-drawer__close,
.hm-tcard-drawer__close {
	width: 40px;
	height: 40px;
	display: grid;
	place-items: center;
	border: 1px solid var(--hm-border);
	border-radius: 10px;
	background: #fff;
	color: var(--hm-muted);
	font-size: 0;
	cursor: pointer;
	transition: background 0.15s ease;
}

.hm-drawer__close:hover,
.hm-tcard-drawer__close:hover {
	background: #f1f5f9;
	color: var(--hm-text);
}

/* Section subtitles inside panels */
.hm-demo__hints-title,
.hm-briefing-detail__title,
.hm-constraints__form-title,
.hm-override__title,
.hm-studio__subtitle {
	font-family: var(--hm-font-display);
	font-size: var(--hm-text-lg);
	font-weight: 600;
}

/* Mirror */
.hm-mirror__topbar {
	display: flex;
	align-items: center;
	padding: 1.25rem 1.5rem;
	background: rgb(255 255 255 / 90%);
	border-bottom: 1px solid var(--hm-border);
	margin-bottom: 1rem;
}

.hm-mirror__topbar-title {
	font-family: var(--hm-font-display);
	font-size: var(--hm-text-2xl);
	font-weight: 700;
	margin: 0;
	letter-spacing: -0.02em;
}

.hm-mirror__topbar-sub {
	margin: 0.125rem 0 0;
	font-size: var(--hm-text-lg);
	color: var(--hm-muted);
}

.hm-mirror__profile-head {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	padding: 0 0 1rem;
	margin-bottom: 0.75rem;
	border-bottom: 1px solid var(--hm-border);
}

.hm-mirror__profile-icon {
	width: 40px;
	height: 40px;
	padding: 9px;
	border-radius: 11px;
	background: linear-gradient(135deg, #0891b2 0%, #2563eb 100%);
	color: #fff;
	flex-shrink: 0;
}

.hm-mirror__profile-title {
	display: block;
	font-family: var(--hm-font-display);
	font-size: var(--hm-text-lg);
	font-weight: 700;
}

.hm-mirror__profile-sub {
	font-size: 0.833rem;
}

.hm-mirror__header {
	padding: 1rem 1.25rem;
}

.hm-mirror__name {
	font-size: var(--hm-text-lg);
}

.hm-mirror__sim-label {
	font-size: var(--hm-text-lg);
	font-weight: 600;
}

/* Heatmap cells — slightly larger text */
.hm-heatmap__label {
	font-size: 0.722rem;
	font-weight: 600;
}

.hm-heatmap__day,
.hm-heatmap__period {
	font-size: 0.833rem;
	font-weight: 600;
}

/* Responsive */
@media (max-width: 960px) {
	html {
		font-size: 17px;
	}

	.hm-app {
		grid-template-columns: 1fr;
	}

	.hm-sidebar {
		flex-direction: row;
		flex-wrap: wrap;
		padding: 1rem;
	}

	.hm-sidebar__brand {
		margin-bottom: 0;
		width: 100%;
	}

	.hm-nav {
		flex-direction: row;
		flex-wrap: wrap;
		width: 100%;
	}

	.hm-sidebar__foot {
		width: 100%;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		border-top: none;
		padding-top: 0;
	}

	.hm-panel__head {
		flex-direction: column;
		gap: 0.75rem;
	}

	.hm-panel__actions {
		width: 100%;
	}

	.hm-schedule-stack {
		grid-row: auto;
		margin-top: 2.25rem;
	}

	.hm-schedule-mascot {
		transform: translate(-50%, -48%);
	}

	.hm-schedule-mascot img {
		width: 88px;
	}

	.hm-sidebar {
		position: relative;
		height: auto;
		max-height: none;
	}
}


/* CONNECTION MAP MODAL */
/* ── מרכז תמיכה (כמו מחולל המצגות) ─────────────────────────────────────── */

.hm-support-overlay {
	position: fixed;
	inset: 0;
	z-index: 12000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.25rem;
	background: rgb(44 62 80 / 70%);
	backdrop-filter: blur(5px);
}

.hm-support-overlay[hidden] {
	display: none !important;
}

body.hm-support-open,
body.hm-modal-open {
	overflow: hidden;
}

.hm-support-box {
	position: relative;
	width: min(400px, 96vw);
	background: #fff;
	border-radius: 20px;
	box-shadow: 0 25px 60px rgb(0 0 0 / 25%);
	overflow: hidden;
	text-align: center;
	animation: hm-modal-in 0.22s ease;
}

.hm-support-box__close {
	position: absolute;
	top: 12px;
	left: 16px;
	border: none;
	background: transparent;
	font-size: 1.75rem;
	line-height: 1;
	color: #bdc3c7;
	cursor: pointer;
	z-index: 2;
}

.hm-support-box__close:hover {
	color: #e74c3c;
}

.hm-support-box__head {
	background: #f8fbff;
	padding: 1.75rem 1.25rem 1.1rem;
	border-bottom: 1px solid #edf2f7;
}

.hm-support-box__logo {
	height: 35px;
	width: auto;
	margin-bottom: 0.85rem;
}

.hm-support-box__title {
	margin: 0 0 0.3rem;
	font-size: 1.15rem;
	color: #2d3748;
}

.hm-support-box__sub {
	margin: 0;
	font-size: 0.86rem;
	color: #718096;
}

.hm-support-box__options {
	padding: 1.35rem;
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
}

.hm-support-card {
	display: flex;
	align-items: center;
	text-decoration: none;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 0.7rem 0.85rem;
	transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.hm-support-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 5px 15px rgb(0 0 0 / 5%);
}

.hm-support-card__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 10px;
	margin-inline-end: 0.85rem;
	flex-shrink: 0;
}

.hm-support-card__icon .hm-icon {
	width: 20px;
	height: 20px;
}

.hm-support-card__text {
	flex: 1;
	text-align: start;
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
}

.hm-support-card__text strong {
	color: #2d3748;
	font-size: 0.92rem;
}

.hm-support-card__text span {
	color: #718096;
	font-size: 0.78rem;
}

.hm-support-card__arrow {
	color: #cbd5e0;
	font-size: 1.1rem;
}

.hm-support-card--wa .hm-support-card__icon { background: #e6fffa; color: #25d366; }
.hm-support-card--wa:hover { border-color: #25d366; }
.hm-support-card--phone .hm-support-card__icon { background: #ebf8ff; color: #3182ce; }
.hm-support-card--phone:hover { border-color: #3182ce; }
.hm-support-card--email .hm-support-card__icon { background: #fff5f5; color: #e53e3e; }
.hm-support-card--email:hover { border-color: #e53e3e; }

.hm-support-box__foot {
	background: #f8fbff;
	padding: 0.55rem;
	font-size: 0.68rem;
	color: #a0aec0;
	border-top: 1px solid #edf2f7;
}

/* ── פופאפים מרכזיים — שיבוץ, כרטיס מורה, מפה ─────────────────────────── */

@keyframes hm-modal-in {
	from { opacity: 0; transform: translateY(12px) scale(0.98); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

.hm-drawer:not([hidden]),
.hm-tcard-drawer:not([hidden]) {
	display: flex !important;
	align-items: center;
	justify-content: center;
	padding: 1.25rem;
}

.hm-drawer__backdrop,
.hm-tcard-drawer__backdrop {
	background: rgb(15 23 42 / 72%);
	backdrop-filter: blur(4px);
}

.hm-drawer__panel {
	position: relative;
	top: auto;
	left: auto;
	height: auto;
	max-height: min(88vh, 720px);
	width: min(540px, 96vw);
	border-radius: 20px;
	box-shadow: 0 25px 60px rgb(0 0 0 / 25%);
	animation: hm-modal-in 0.22s ease;
}

.hm-tcard-drawer__panel {
	position: relative;
	top: auto;
	left: auto;
	height: auto;
	max-height: min(90vh, 860px);
	width: min(780px, 96vw);
	border-radius: 20px;
	box-shadow: 0 25px 60px rgb(0 0 0 / 25%);
	animation: hm-modal-in 0.22s ease;
}

.hm-tcard-drawer__panel {
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.hm-tcard-drawer__body {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
}

.hm-drawer__body {
	flex: 1;
	min-height: 0;
}

.hm-drawer__panel {
	display: flex;
	flex-direction: column;
}

.hm-cmap-overlay{position:fixed;inset:0;background:rgba(15,23,42,.72);backdrop-filter:blur(4px);z-index:9000;display:flex;align-items:center;justify-content:center;padding:1.5rem}
.hm-cmap-overlay[hidden]{display:none}
.hm-cmap-modal{background:#fff;border-radius:1.25rem;width:100%;max-width:920px;box-shadow:0 24px 64px rgba(0,0,0,.25);display:flex;flex-direction:column;overflow:hidden;position:relative;animation:hm-cmap-in .22s ease}
@keyframes hm-cmap-in{from{opacity:0;transform:scale(.95) translateY(12px)}to{opacity:1;transform:none}}
.hm-cmap-close{position:absolute;top:1rem;left:1rem;width:2rem;height:2rem;border-radius:50%;border:none;background:#f1f5f9;color:#475569;cursor:pointer;font-size:.85rem;z-index:1}
.hm-cmap-close:hover{background:#e2e8f0}
.hm-cmap-header{padding:1.25rem 1.5rem 1rem;border-bottom:1px solid #e2e8f0}
.hm-cmap-header__title{font-size:1.1rem;font-weight:700;color:#0f172a;direction:rtl}
.hm-cmap-header__meta{font-size:.8rem;color:#64748b;direction:rtl;margin-top:.25rem;display:flex;gap:1rem;flex-wrap:wrap}
.hm-cmap-meta-chip{display:inline-flex;align-items:center;gap:.3rem;padding:.15rem .55rem;border-radius:1rem;font-weight:600;font-size:.75rem}
.hm-cmap-meta-chip--stable{background:#dcfce7;color:#166534}
.hm-cmap-meta-chip--watch{background:#fef9c3;color:#854d0e}
.hm-cmap-meta-chip--critical{background:#fee2e2;color:#991b1b}
.hm-cmap-body{display:flex;height:520px}
.hm-cmap-canvas{flex:0 0 560px;display:block;cursor:pointer}
.hm-cmap-sidebar{flex:1;padding:1rem 1rem 1rem 1.25rem;border-right:1px solid #e2e8f0;overflow-y:auto;display:flex;flex-direction:column;gap:1rem}
.hm-cmap-kpis{display:flex;flex-direction:column;gap:.5rem}
.hm-cmap-kpi{display:flex;justify-content:space-between;font-size:.8rem;color:#374151;direction:rtl}
.hm-cmap-kpi strong{color:#0f172a}
.hm-cmap-detail{flex:1;border-top:1px solid #f1f5f9;padding-top:.75rem}
.hm-cmap-hint{color:#94a3b8;font-size:.8rem;text-align:center;direction:rtl;margin-top:2rem}
.hm-cmap-teacher-card{direction:rtl;display:flex;flex-direction:column;gap:.4rem}
.hm-cmap-teacher-card__name{font-size:.95rem;font-weight:700;color:#0f172a}
.hm-cmap-teacher-card__subject{font-size:.8rem;color:#64748b}
.hm-cmap-teacher-card__score{font-size:1.2rem;font-weight:800}
.hm-cmap-score--stable{color:#16a34a}.hm-cmap-score--watch{color:#ca8a04}.hm-cmap-score--critical{color:#dc2626}
.hm-cmap-teacher-card__breakdown{display:grid;grid-template-columns:1fr 1fr;gap:.3rem .5rem;margin-top:.25rem}
.hm-cmap-breakdown-item{font-size:.72rem;color:#475569;display:flex;justify-content:space-between;border-bottom:1px dotted #e2e8f0;padding-bottom:.1rem}
.hm-cmap-teacher-card__badges{display:flex;gap:.35rem;flex-wrap:wrap}
.hm-cmap-badge{font-size:.68rem;padding:.1rem .4rem;border-radius:.75rem;font-weight:600}
.hm-cmap-badge--deadlock{background:#fee2e2;color:#991b1b}
.hm-cmap-badge--today{background:#dbeafe;color:#1e40af}
.hm-cmap-badge--role{background:#f1f5f9;color:#475569}
.hm-slot-class-link{cursor:pointer;text-decoration:underline dotted;color:inherit}
.hm-slot-class-link:hover{color:#2563eb}


/* INSTITUTION SETUP WIZARD */
.hm-panel--setup{grid-column:1/-1}
.hm-setup-wizard{padding:.5rem 0}
.hm-setup-tabs{display:flex;gap:.35rem;border-bottom:2px solid #e2e8f0;margin-bottom:1.25rem}
.hm-setup-tab{padding:.45rem 1rem;border:none;background:none;border-radius:.5rem .5rem 0 0;font-size:.82rem;font-weight:600;color:#64748b;cursor:pointer;transition:all .15s;border-bottom:2px solid transparent;margin-bottom:-2px}
.hm-setup-tab:hover{color:#2563eb;background:#f8fafc}
.hm-setup-tab--active{color:#2563eb;border-bottom-color:#2563eb;background:#eff6ff}
.hm-setup-pane{display:none}
.hm-setup-pane--active{display:block}
.hm-setup-form{display:flex;flex-direction:column;gap:.75rem;max-width:560px}
.hm-setup-row{display:flex;align-items:center;gap:.75rem;direction:rtl}
.hm-setup-row--checkbox{gap:.5rem}
.hm-setup-label{min-width:160px;font-size:.82rem;color:#374151;font-weight:500;text-align:right}
.hm-setup-input{flex:1;padding:.4rem .65rem;border:1px solid #d1d5db;border-radius:.4rem;font-size:.82rem;direction:rtl}
.hm-setup-input--sm{flex:0 0 100px}
.hm-setup-range{flex:1;accent-color:#2563eb}
.hm-setup-range-val{min-width:2rem;font-weight:700;color:#2563eb;font-size:.85rem}
.hm-setup-actions{display:flex;align-items:center;gap:.75rem;margin-top:.5rem}
.hm-setup-status{font-size:.78rem;color:#16a34a}
.hm-setup-status--err{color:#dc2626}
.hm-setup-hint{font-size:.8rem;color:#64748b;direction:rtl;margin-bottom:.75rem}

/* Bell schedule table */
.hm-bell-table{display:grid;grid-template-columns:auto 1fr 1fr 1fr;gap:.35rem;font-size:.8rem;direction:rtl}
.hm-bell-hdr{font-weight:700;color:#374151;padding:.25rem .5rem;background:#f8fafc;border-radius:.25rem}
.hm-bell-cell{padding:.25rem .35rem}
.hm-bell-cell input[type=time]{border:1px solid #d1d5db;border-radius:.3rem;padding:.2rem .4rem;font-size:.78rem}
.hm-bell-cell input[type=text]{border:1px solid #d1d5db;border-radius:.3rem;padding:.2rem .4rem;font-size:.78rem;width:100%}

/* Holiday list */
.hm-holiday-sync-bar{display:flex;align-items:center;gap:1rem;flex-wrap:wrap;padding:.75rem 1rem;background:#f0f9ff;border-radius:.6rem;border:1px solid #bae6fd;margin-bottom:1rem;direction:rtl}
.hm-holiday-sync-bar__text{flex:1}
.hm-holiday-sync-bar__text strong{display:block;font-size:.88rem;color:#0f172a}
.hm-holiday-sync-bar__text span{font-size:.78rem}
.hm-holiday-sync-bar__actions{display:flex;gap:.5rem;align-items:center}
.hm-holidays-list{display:flex;flex-direction:column;gap:.35rem;max-height:340px;overflow-y:auto}
.hm-holiday-item{display:flex;align-items:center;gap:.75rem;padding:.4rem .65rem;border-radius:.4rem;background:#f8fafc;font-size:.8rem;direction:rtl}
.hm-holiday-item__date{font-weight:700;color:#0f172a;min-width:90px}
.hm-holiday-item__title{flex:1;color:#374151}
.hm-holiday-chip{font-size:.68rem;padding:.1rem .45rem;border-radius:.75rem;font-weight:600}
.hm-holiday-chip--holiday{background:#fee2e2;color:#991b1b}
.hm-holiday-chip--vacation{background:#fef9c3;color:#854d0e}
.hm-holiday-chip--national{background:#dbeafe;color:#1e40af}
.hm-holiday-chip--minor{background:#f1f5f9;color:#475569}

/* General blocks grid */
.hm-blocks-legend{display:flex;gap:.75rem;font-size:.75rem;margin-bottom:.5rem;direction:rtl}
.hm-blocks-legend__free{padding:.15rem .5rem;border:1px solid #d1d5db;border-radius:.3rem;color:#64748b}
.hm-blocks-legend__blocked{padding:.15rem .5rem;background:#fee2e2;color:#dc2626;border-radius:.3rem;font-weight:600}
.hm-blocks-grid{display:grid;gap:4px;direction:rtl}
.hm-blocks-cell{height:36px;border-radius:.35rem;border:1px solid #e2e8f0;background:#f8fafc;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:.75rem;color:#64748b;transition:all .12s;user-select:none}
.hm-blocks-cell:hover{background:#eff6ff;border-color:#93c5fd}
.hm-blocks-cell--blocked{background:#fee2e2;border-color:#fca5a5;color:#dc2626;font-weight:700}
.hm-blocks-cell--header{background:none;border:none;cursor:default;font-weight:600;color:#374151}
.hm-blocks-cell--header:hover{background:none}

/* ── Institution Banner (dashboard top-bar) ─────────────────────────────── */

.hm-inst-banner {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.6rem 1.25rem;
	background: rgba(96,165,250,0.07);
	border-bottom: 1px solid rgba(96,165,250,0.15);
	flex-wrap: wrap;
}

.hm-inst-banner__label {
	font-size: 0.8rem;
	font-weight: 700;
	color: #94a3b8;
	white-space: nowrap;
}

.hm-inst-banner__chips {
	display: flex;
	gap: 0.4rem;
	flex: 1;
	flex-wrap: wrap;
}

.hm-inst-chip {
	padding: 0.25rem 0.75rem;
	border-radius: 2rem;
	font-size: 0.8rem;
	border: 1px solid rgba(255,255,255,0.1);
	background: rgba(255,255,255,0.05);
	color: #94a3b8;
	cursor: pointer;
	transition: all 0.15s;
	display: flex;
	align-items: center;
	gap: 0.4rem;
}
.hm-inst-chip:hover { background: rgba(96,165,250,0.12); color: #e2e8f0; border-color: rgba(96,165,250,0.3); }
.hm-inst-chip--active { background: rgba(96,165,250,0.18); color: #60a5fa; border-color: #3b82f6; font-weight: 600; }
.hm-inst-chip--loading, .hm-inst-chip--none { opacity: 0.5; cursor: default; }
.hm-inst-chip__cnt { font-size: 0.72rem; color: #64748b; }

/* ── Institution Home Panel (dashboard main screen) ─────────────────────── */

.hm-panel--inst-home {
	margin-bottom: 1.25rem;
	background: linear-gradient(135deg, rgba(59,130,246,0.08) 0%, rgba(15,23,42,0.4) 100%);
	border: 1px solid rgba(96,165,250,0.18);
}

.hm-inst-home__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
	margin-bottom: 1.25rem;
}

.hm-inst-home__title {
	margin: 0 0 0.25rem;
	font-size: 1.35rem;
	font-weight: 800;
	color: var(--hm-text, #f1f5f9);
}

.hm-inst-home__sub {
	margin: 0;
	color: var(--hm-muted, #94a3b8);
	font-size: 0.9rem;
}

.hm-inst-home__actions {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.hm-inst-home__loading,
.hm-inst-home__error {
	font-size: 0.88rem;
	color: var(--hm-muted, #94a3b8);
}

.hm-inst-home__error { color: #f87171; }

.hm-inst-home__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 0.85rem;
	margin-bottom: 1rem;
}

.hm-inst-card {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	padding: 1rem 1.1rem;
	background: rgba(255,255,255,0.04);
	border: 1px solid rgba(255,255,255,0.1);
	border-radius: 0.85rem;
	cursor: pointer;
	text-align: right;
	transition: all 0.18s;
	color: inherit;
	width: 100%;
}

.hm-inst-card:hover {
	background: rgba(96,165,250,0.1);
	border-color: rgba(96,165,250,0.35);
	transform: translateY(-2px);
}

.hm-inst-card--active {
	background: rgba(96,165,250,0.14);
	border-color: #3b82f6;
	box-shadow: 0 0 0 1px rgba(59,130,246,0.25);
}

.hm-inst-card__icon { font-size: 2rem; flex-shrink: 0; }
.hm-inst-card__body { flex: 1; min-width: 0; }
.hm-inst-card__name { font-weight: 700; font-size: 1rem; color: #f1f5f9; margin-bottom: 0.15rem; }
.hm-inst-card__meta { font-size: 0.78rem; color: #64748b; margin-bottom: 0.45rem; }
.hm-inst-card__stats { display: flex; gap: 0.65rem; flex-wrap: wrap; font-size: 0.75rem; color: #60a5fa; }
.hm-inst-card__enter { font-size: 0.78rem; color: #94a3b8; white-space: nowrap; }

.hm-inst-home__empty {
	text-align: center;
	padding: 2rem 1rem;
	border: 1px dashed rgba(255,255,255,0.12);
	border-radius: 0.75rem;
}

.hm-inst-home__empty-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.hm-inst-home__empty h3 { margin: 0 0 0.5rem; color: #e2e8f0; }
.hm-inst-home__empty p { margin: 0 0 1rem; color: #64748b; font-size: 0.88rem; }

.hm-inst-home__selected {
	display: flex;
	align-items: center;
	gap: 1rem;
	flex-wrap: wrap;
	padding: 0.75rem 1rem;
	background: rgba(16,185,129,0.08);
	border: 1px solid rgba(16,185,129,0.2);
	border-radius: 0.65rem;
}

.hm-inst-home__selected-label { font-size: 0.78rem; color: #64748b; font-weight: 700; }
.hm-inst-home__selected-name { font-weight: 800; color: #34d399; font-size: 1rem; }
.hm-inst-home__selected-stats { display: flex; gap: 0.85rem; flex-wrap: wrap; font-size: 0.8rem; color: #94a3b8; }

/* ── מצב ויזואליזציה (קובייה / מסלול הקשרים) — הדר מצומצם, ללא גלילה ──── */

.hm-app__body:has(#hm-dashboard-root:not([data-view="operational"])) .hm-topbar__hub {
	display: none;
}

.hm-app__body:has(#hm-dashboard-root:not([data-view="operational"])) .hm-topbar {
	padding: 0.35rem 1.25rem;
}

#hm-dashboard-root:not([data-view="operational"]) {
	padding-top: 0.5rem;
	padding-bottom: 0.5rem;
}

.hm-panel--cube .hm-panel__head,
.hm-panel--context-map .hm-panel__head {
	margin-bottom: 0.6rem;
	padding-bottom: 0.5rem;
}

.hm-panel--cube .hm-panel__subtitle,
.hm-panel--context-map .hm-panel__subtitle {
	display: none;
}

.hm-panel--cube .hm-panel__title,
.hm-panel--context-map .hm-panel__title {
	font-size: 1.1rem;
}

.hm-panel--cube,
.hm-panel--context-map {
	padding: 0.85rem 1.25rem;
}

/* הבמה תופסת את גובה החלון — בלי גלילת עמוד */
.hm-panel--cube .hm-cube__svg-wrap {
	height: clamp(360px, calc(100vh - 320px), 760px);
}

.hm-panel--cube .hm-cube__svg {
	width: 100%;
	height: 100%;
}

.hm-panel--context-map .hm-cmap3d__stage {
	min-height: 0;
}

.hm-panel--context-map .hm-cmap3d__svg-wrap {
	height: clamp(340px, calc(100vh - 380px), 760px);
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.hm-panel--context-map .hm-cmap3d__svg-wrap > svg {
	width: 100%;
	height: 100%;
}

/* ── מפת חום — מסך מלא בלי גלילת עמוד ─────────────────────────────────── */

body.hm-dash-view-heatmap {
	overflow: hidden;
}

body.hm-dash-view-heatmap .hm-app--school {
	height: calc(100vh - var(--wp-admin--admin-bar--height, 0px));
	max-height: calc(100vh - var(--wp-admin--admin-bar--height, 0px));
	overflow: hidden;
	align-items: stretch;
}

body.admin-bar.hm-dash-view-heatmap .hm-app--school {
	height: calc(100vh - 32px);
	max-height: calc(100vh - 32px);
}

body.hm-dash-view-heatmap .hm-sidebar {
	height: 100%;
	max-height: 100%;
}

body.hm-dash-view-heatmap .hm-app__body {
	flex: 1;
	min-height: 0;
	max-height: 100%;
	overflow: hidden;
}

body.hm-dash-view-heatmap .hm-dashboard {
	flex: 1;
	min-height: 0;
	padding: 0.5rem 1.25rem 0.65rem;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

body.hm-dash-view-heatmap #hm-dash-foot {
	display: none;
}

#hm-dashboard-root[data-view="heatmap"] > #hm-heatmap-panel:not([hidden]) {
	flex: 1;
	min-height: 0;
	max-height: 100%;
	display: flex !important;
	flex-direction: column;
	overflow: hidden;
	padding: 0.65rem 1.1rem 0.75rem;
}

#hm-dashboard-root[data-view="heatmap"] .hm-schedule-stack--page {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 0;
	overflow: hidden;
}

#hm-dashboard-root[data-view="heatmap"] .hm-panel--schedule {
	overflow: hidden;
	padding-top: 0.5rem;
}

#hm-dashboard-root[data-view="heatmap"] .hm-schedule-mascot,
#hm-dashboard-root[data-view="heatmap"] .hm-panel__subtitle,
#hm-dashboard-root[data-view="heatmap"] .hm-panel__note {
	display: none;
}

#hm-dashboard-root[data-view="heatmap"] .hm-panel__head {
	flex-shrink: 0;
	margin-bottom: 0.45rem;
	padding-bottom: 0.45rem;
}

#hm-dashboard-root[data-view="heatmap"] .hm-panel__title {
	font-size: 1.1rem;
}

#hm-dashboard-root[data-view="heatmap"] .hm-panel__icon {
	width: 40px;
	height: 40px;
	padding: 9px;
}

#hm-dashboard-root[data-view="heatmap"] .hm-heatmap-legend--top {
	flex-shrink: 0;
	margin: 0 0 0.45rem;
	padding: 0.35rem 0.55rem;
	gap: 0.45rem 0.75rem;
	font-size: 0.68rem;
}

#hm-dashboard-root[data-view="heatmap"] #hm-heatmap-root {
	flex: 1;
	min-height: 0;
	align-content: stretch;
}

#hm-dashboard-root[data-view="heatmap"] .hm-heatmap:not(.hm-heatmap--month) {
	grid-template-rows: auto repeat(8, minmax(0, 1fr));
}

#hm-dashboard-root[data-view="heatmap"] .hm-heatmap--month {
	grid-template-rows: auto repeat(5, minmax(0, 1fr));
}

#hm-dashboard-root[data-view="heatmap"] .hm-heatmap__cell {
	aspect-ratio: unset;
	min-height: 0;
	height: 100%;
}

#hm-dashboard-root[data-view="heatmap"] .hm-heatmap--day .hm-heatmap__cell {
	min-height: 0;
}

#hm-dashboard-root[data-view="heatmap"] .hm-heatmap__label {
	font-size: clamp(0.58rem, 0.9vw, 0.7rem);
	line-height: 1.15;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

/* ── קיפול פאנלים ─────────────────────────────────────────────────────── */

.hm-panel__collapse-btn {
	margin-inline-start: auto;
	flex-shrink: 0;
	width: 26px;
	height: 26px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--hm-border);
	border-radius: 8px;
	background: transparent;
	color: var(--hm-muted);
	cursor: pointer;
	transition: transform 0.18s ease, background 0.15s ease;
}

.hm-panel__collapse-btn:hover {
	background: rgb(99 102 241 / 8%);
	color: var(--hm-text);
}

.hm-panel--collapsed .hm-panel__collapse-btn {
	transform: rotate(180deg);
}

.hm-panel--collapsed > *:not(.hm-panel__head) {
	display: none !important;
}

.hm-panel--collapsed .hm-panel__head {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: none;
}
