/* Dashboard Styles - Theme System */

/* Import fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ============================================
   CSS Variables - Dark Theme (Default)
   ============================================ */
:root {
	/* Background colors */
	--color-bg-primary: #0f0f0f;
	--color-bg-secondary: #1a1a1a;
	--color-bg-tertiary: #2C2E34;
	--color-bg-card: #252525;
	--color-bg-card-alt: #1f1f1f;
	--color-bg-hover: #2a2a2a;
	--color-bg-input: #151515;
	
	/* Text colors */
	--color-text-primary: #ffffff;
	--color-text-secondary: #b0b0b0;
	--color-text-muted: #888888;
	--color-text-dimmed: #666666;
	--color-text-hint: #555555;
	
	/* Border colors */
	--color-border: #2a2a2a;
	--color-border-light: #3a3a3a;
	--color-border-dark: #1a1a1a;
	
	/* Accent colors (same in both themes) */
	--color-accent-blue: #4a9eff;
	--color-accent-blue-dark: #3a8eef;
	--color-accent-blue-alt: #4285F4;
	--color-accent-green: #4ade80;
	--color-accent-green-dark: #34A853;
	--color-accent-green-darker: #2d9549;
	--color-accent-red: #ef4444;
	--color-accent-red-dark: #EA4335;
	--color-accent-red-alt: #db4437;
	--color-accent-orange: #f59e0b;
	--color-accent-orange-light: #fb923c;
	--color-accent-yellow: #F4B400;
	--color-accent-purple: #a855f7;
	--color-accent-purple-alt: #9C27B0;
	--color-accent-indigo: #6366f1;
	
	/* Status colors */
	--color-status-confirmed: #4ade80;
	--color-status-option: #f59e0b;
	--color-status-tbc: #a855f7;
	
	/* Overlay colors */
	--color-overlay-light: rgba(255, 255, 255, 0.1);
	--color-overlay-lighter: rgba(255, 255, 255, 0.05);
	--color-overlay-dark: rgba(0, 0, 0, 0.3);
	--color-overlay-darker: rgba(0, 0, 0, 0.5);
	
	/* Shadow */
	--color-shadow: rgba(0, 0, 0, 0.3);
	
	/* Legacy variables (for backwards compatibility) */
	--bg-secondary: var(--color-bg-secondary);
	--bg-tertiary: var(--color-bg-tertiary);
}

/* ============================================
   CSS Variables - Light Theme
   ============================================ */
body.mg-dashboard-page.theme-light {
	/* Background colors */
	--color-bg-primary: #f0f2f5;
	--color-bg-secondary: #ffffff;
	--color-bg-tertiary: #e4e6eb;
	--color-bg-card: #ffffff;
	--color-bg-card-alt: #f7f8fa;
	--color-bg-hover: #e4e6eb;
	--color-bg-input: #f7f8fa;
	
	/* Text colors */
	--color-text-primary: #1c1e21;
	--color-text-secondary: #606770;
	--color-text-muted: #8a8d91;
	--color-text-dimmed: #b0b3b8;
	--color-text-hint: #c4c4c4;
	
	/* Border colors */
	--color-border: #dddfe2;
	--color-border-light: #ced0d4;
	--color-border-dark: #bec3c9;
	
	/* Overlay colors (inverted for light mode) */
	--color-overlay-light: rgba(0, 0, 0, 0.04);
	--color-overlay-lighter: rgba(0, 0, 0, 0.02);
	--color-overlay-dark: rgba(0, 0, 0, 0.08);
	--color-overlay-darker: rgba(0, 0, 0, 0.15);
	
	/* Shadow - lighter for light mode */
	--color-shadow: rgba(0, 0, 0, 0.08);
}

/* Light mode specific overrides */
body.mg-dashboard-page.theme-light .mg-stat-tile {
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
}

body.mg-dashboard-page.theme-light .mg-chart-container {
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
}

body.mg-dashboard-page.theme-light .mg-dashboard-table {
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
}

body.mg-dashboard-page.theme-light .mg-dashboard-header-fixed {
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

body.mg-dashboard-page.theme-light .mg-dashboard-footer-fixed {
	box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.08);
}

/* Light mode table overrides */
body.mg-dashboard-page.theme-light .mg-dashboard-table th {
	background: var(--color-bg-card);
}

body.mg-dashboard-page.theme-light #mg-budget-table thead th.col-project-type {
	background: var(--color-bg-card);
}

body.mg-dashboard-page.theme-light .mg-budget-table thead {
	background: var(--color-bg-card);
}

body.mg-dashboard-page.theme-light .mg-dashboard-table tfoot tr.mg-table-total {
	background: var(--color-bg-card) !important;
}

body.mg-dashboard-page.theme-light #mg-budget-table tfoot td {
	background: var(--color-bg-card) !important;
}

body.mg-dashboard-page.theme-light .mg-dashboard-table tfoot td {
	background: var(--color-bg-card) !important;
}

body.mg-dashboard-page.theme-light .mg-budget-table tbody tr.mg-budget-item:hover {
	background: var(--color-bg-hover);
}

body.mg-dashboard-page.theme-light #mg-budget-table thead th.col-bezoekers-group {
	background: linear-gradient(rgba(66, 133, 244, 0.15), rgba(66, 133, 244, 0.15)), var(--color-bg-card) !important;
}

body.mg-dashboard-page.theme-light #mg-budget-table thead th.col-horeca-group {
	background: linear-gradient(rgba(244, 180, 0, 0.15), rgba(244, 180, 0, 0.15)), var(--color-bg-card) !important;
}

body.mg-dashboard-page.theme-light #mg-budget-table td.col-bezoekers-group {
	background-color: rgba(66, 133, 244, 0.08) !important;
}

body.mg-dashboard-page.theme-light #mg-budget-table td.col-horeca-group {
	background-color: rgba(244, 180, 0, 0.08) !important;
}

body.mg-dashboard-page.theme-light #mg-budget-table th.col-bezoekers-header {
	background: linear-gradient(rgba(66, 133, 244, 0.15), rgba(66, 133, 244, 0.15)), var(--color-bg-card) !important;
}

body.mg-dashboard-page.theme-light #mg-budget-table th.col-horeca-header {
	background: linear-gradient(rgba(244, 180, 0, 0.15), rgba(244, 180, 0, 0.15)), var(--color-bg-card) !important;
}

body.mg-dashboard-page.theme-light #mg-budget-table tfoot td.col-bezoekers-group,
body.mg-dashboard-page.theme-light .mg-dashboard-table tfoot td.col-bezoekers-group {
	background-color: rgba(66, 133, 244, 0.15) !important;
}

body.mg-dashboard-page.theme-light #mg-budget-table tfoot td.col-horeca-group,
body.mg-dashboard-page.theme-light .mg-dashboard-table tfoot td.col-horeca-group {
	background-color: rgba(244, 180, 0, 0.15) !important;
}

/* Light mode scrollbar overrides */
body.mg-dashboard-page.theme-light .mg-dashboard-table .mg-table-wrapper {
	scrollbar-color: #c4c4c4 #f0f2f5;
}

body.mg-dashboard-page.theme-light .mg-dashboard-table .mg-table-wrapper::-webkit-scrollbar-track {
	background: #f0f2f5;
}

body.mg-dashboard-page.theme-light .mg-dashboard-table .mg-table-wrapper::-webkit-scrollbar-thumb {
	background: #c4c4c4;
}

body.mg-dashboard-page.theme-light .mg-dashboard-table .mg-table-wrapper::-webkit-scrollbar-thumb:hover {
	background: #a0a0a0;
}

body.mg-dashboard-page.theme-light .mg-tooltip-content {
	scrollbar-color: #c4c4c4 #f0f2f5;
}

body.mg-dashboard-page.theme-light .mg-tooltip-content::-webkit-scrollbar-track {
	background: #f0f2f5;
}

body.mg-dashboard-page.theme-light .mg-tooltip-content::-webkit-scrollbar-thumb {
	background: #c4c4c4;
}

body.mg-dashboard-page.theme-light .mg-tooltip-content::-webkit-scrollbar-thumb:hover {
	background: #a0a0a0;
}

body.mg-dashboard-page.theme-light .mg-sidebar-sections {
	scrollbar-color: #c4c4c4 var(--color-bg-secondary);
}

body.mg-dashboard-page.theme-light .mg-sidebar-sections::-webkit-scrollbar-track {
	background: var(--color-bg-secondary);
}

body.mg-dashboard-page.theme-light .mg-sidebar-sections::-webkit-scrollbar-thumb {
	background: #c4c4c4;
}

body.mg-dashboard-page.theme-light .mg-sidebar-sections::-webkit-scrollbar-thumb:hover {
	background: #a0a0a0;
}

/* Theme transition for smooth switching */
body.mg-dashboard-page {
	transition: background-color 0.3s ease, color 0.3s ease;
}

body.mg-dashboard-page {
	background: var(--color-bg-primary);
	min-height: 100vh;
	color: var(--color-text-primary);
	overflow-x: hidden;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
	position: relative;
}

body.mg-dashboard-page * {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body.mg-dashboard-page code,
body.mg-dashboard-page pre,
body.mg-dashboard-page .mg-stat-tile .value,
body.mg-dashboard-page input[type="number"],
body.mg-dashboard-page .mg-dashboard-table td.col-number {
	font-family: 'JetBrains Mono', 'Courier New', monospace;
	font-variant-numeric: tabular-nums;
}

.mg-dashboard-wrapper {
	max-width: 100%;
	margin: 0 auto;
	padding: 1.5rem;
	width: 100%;
	box-sizing: border-box;
	display: flex;
	gap: 1.5rem;
	position: relative;
}

.mg-dashboard-main {
	flex: 1;
	min-width: 0;
	transition: margin-left 0.3s ease;
	padding-top: 0;
	margin-top: 0;
}

.mg-sidebar-filter {
	position: fixed;
	left: 0;
	top: 0;
	height: 100vh;
	width: 320px;
	background: var(--color-bg-secondary);
	border-right: 1px solid var(--color-border);
	z-index: 1000;
	transform: translateX(-100%);
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	overflow-y: auto;
	overflow-x: hidden;
	box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
	display: flex;
	flex-direction: column;
}

.mg-sidebar-filter.open {
	transform: translateX(0);
}

/* Sidebar scrollbar styling */
.mg-sidebar-filter::-webkit-scrollbar {
	width: 6px;
}

.mg-sidebar-filter::-webkit-scrollbar-track {
	background: transparent;
}

.mg-sidebar-filter::-webkit-scrollbar-thumb {
	background: var(--color-border-light);
	border-radius: 3px;
}

.mg-sidebar-filter::-webkit-scrollbar-thumb:hover {
	background: var(--color-text-muted);
}

.mg-sidebar-content {
	padding: 0;
	flex: 1;
	display: flex;
	flex-direction: column;
	min-height: 0; /* Important for flex overflow */
	overflow: hidden;
}

.mg-sidebar-header {
	padding: 1.25rem 1.5rem;
	border-bottom: 1px solid var(--color-border);
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: var(--color-overlay-dark);
	flex-shrink: 0;
}

.mg-sidebar-header h3 {
	margin: 0;
	font-size: 1rem;
	font-weight: 600;
	color: var(--color-text-primary);
	font-family: 'Inter', sans-serif;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.mg-sidebar-header h3::before {
	content: '';
	width: 3px;
	height: 16px;
	background: linear-gradient(180deg, #4a9eff, #6366f1);
	border-radius: 2px;
}

.mg-sidebar-close {
	background: none;
	border: none;
	color: var(--color-text-dimmed);
	cursor: pointer;
	padding: 0.25rem;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 4px;
	transition: all 0.2s ease;
}

.mg-sidebar-close:hover {
	background: var(--color-bg-hover);
	color: var(--color-text-primary);
}

.mg-sidebar-clear-all {
	font-size: 11px;
	color: var(--color-text-dimmed);
	background: none;
	border: none;
	cursor: pointer;
	padding: 0.25rem 0.5rem;
	border-radius: 4px;
	transition: all 0.2s ease;
	font-family: 'Inter', sans-serif;
}

.mg-sidebar-clear-all:hover {
	background: #2a2a2a;
	color: #ef4444;
}

/* Search bar */
.mg-filter-search-wrapper {
	padding: 1rem 1.5rem;
	border-bottom: 1px solid var(--color-border);
	flex-shrink: 0;
}

.mg-filter-search {
	width: 100%;
	padding: 0.625rem 1rem 0.625rem 2.5rem;
	background: var(--color-bg-input);
	border: 1px solid var(--color-border);
	border-radius: 8px;
	color: var(--color-text-primary);
	font-size: 13px;
	font-family: 'Inter', sans-serif;
	transition: all 0.2s ease;
}

.mg-filter-search:focus {
	outline: none;
	border-color: var(--color-accent-blue);
	box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}

.mg-filter-search::placeholder {
	color: var(--color-text-muted);
}

.mg-filter-search-icon {
	position: absolute;
	left: 0.875rem;
	top: 50%;
	transform: translateY(-50%);
	color: var(--color-text-muted);
	pointer-events: none;
}

.mg-filter-search-wrapper {
	position: relative;
}

/* Filter sections container */
.mg-sidebar-sections {
	flex: 1;
	overflow-y: auto;
	overflow-x: hidden;
	padding: 0.5rem 0;
	min-height: 0; /* Important for flex overflow */
	scrollbar-width: thin;
	scrollbar-color: var(--color-border-light) var(--color-bg-secondary);
}

.mg-sidebar-sections::-webkit-scrollbar {
	width: 6px;
}

.mg-sidebar-sections::-webkit-scrollbar-track {
	background: var(--color-bg-secondary);
}

.mg-sidebar-sections::-webkit-scrollbar-thumb {
	background: var(--color-border-light);
	border-radius: 3px;
}

.mg-sidebar-sections::-webkit-scrollbar-thumb:hover {
	background: #4a4a4a;
}

/* Collapsible filter section */
.mg-filter-section {
	border-bottom: 1px solid var(--color-border);
}

.mg-filter-section:last-child {
	border-bottom: none;
}

.mg-filter-section-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.875rem 1.5rem;
	cursor: pointer;
	transition: background 0.2s ease;
	user-select: none;
}

.mg-filter-section-header:hover {
	background: var(--color-overlay-lighter);
}

.mg-filter-section-title {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--color-text-secondary);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	font-family: 'Inter', sans-serif;
}

.mg-filter-section-toggle {
	color: #555;
	transition: transform 0.2s ease;
	flex-shrink: 0;
}

.mg-filter-section.open .mg-filter-section-toggle {
	transform: rotate(180deg);
}

.mg-filter-section-badge {
	font-size: 10px;
	font-weight: 500;
	color: var(--color-accent-blue);
	background: rgba(74, 158, 255, 0.1);
	padding: 0.125rem 0.375rem;
	border-radius: 4px;
	margin-left: 0.25rem;
}

.mg-filter-section-actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.mg-filter-section-clear {
	font-size: 10px;
	color: #555;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0.25rem 0.5rem;
	border-radius: 4px;
	transition: all 0.2s ease;
	font-family: 'Inter', sans-serif;
	opacity: 0;
}

.mg-filter-section-header:hover .mg-filter-section-clear,
.mg-filter-section-clear.visible {
	opacity: 1;
}

.mg-filter-section-clear:hover {
	background: var(--color-bg-hover);
	color: #ef4444;
}

.mg-filter-section-content {
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mg-filter-section.open .mg-filter-section-content {
	max-height: 2000px; /* Large enough to fit all items without scroll */
	overflow: visible;
}

.mg-filter-section-list {
	padding: 0 1.5rem 1rem 1.5rem;
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

/* Legacy section styling (for backwards compatibility) */
.mg-sidebar-section {
	margin-bottom: 0;
	padding: 0;
}

.mg-sidebar-section h4 {
	margin: 0;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--color-text-secondary);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	font-family: 'Inter', sans-serif;
}

.mg-status-filters {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.mg-status-filter-item,
.mg-filter-item {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	cursor: pointer;
	padding: 0.5rem 0.625rem;
	border-radius: 6px;
	transition: all 0.15s ease;
	background: transparent;
}

.mg-status-filter-item:hover,
.mg-filter-item:hover {
	background: rgba(74, 158, 255, 0.08);
}

.mg-status-filter-item.checked,
.mg-filter-item.checked {
	background: rgba(74, 158, 255, 0.12);
}

.mg-status-filter-checkbox,
.mg-filter-checkbox {
	width: 16px;
	height: 16px;
	cursor: pointer;
	accent-color: var(--color-accent-blue);
	flex-shrink: 0;
	border-radius: 3px;
}

.mg-status-filter-item .mg-service-fee-toggle {
	width: 16px;
	height: 16px;
	cursor: pointer;
	accent-color: var(--color-accent-blue);
	flex-shrink: 0;
}

.mg-status-filter-label,
.mg-filter-label {
	font-size: 12.5px;
	color: #e0e0e0;
	font-family: 'Inter', sans-serif;
	font-weight: 450;
	flex: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mg-filter-item.checked .mg-filter-label {
	color: var(--color-text-primary);
	font-weight: 500;
}

/* Count bar container */
.mg-filter-count-wrapper {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	min-width: 70px;
}

.mg-filter-count-bar {
	flex: 1;
	height: 4px;
	background: var(--color-bg-card-alt);
	border-radius: 2px;
	overflow: hidden;
}

.mg-filter-count-bar-fill {
	height: 100%;
	background: linear-gradient(90deg, #4a9eff, #6366f1);
	border-radius: 2px;
	transition: width 0.3s ease;
}

.mg-status-filter-count,
.mg-filter-count {
	font-size: 11px;
	color: var(--color-text-dimmed);
	font-family: 'JetBrains Mono', monospace;
	font-variant-numeric: tabular-nums;
	min-width: 24px;
	text-align: right;
}

.mg-sidebar-actions {
	margin-top: 0;
	padding: 1rem 1.5rem;
	border-top: 1px solid var(--color-border);
	background: rgba(0, 0, 0, 0.2);
	flex-shrink: 0;
}

.mg-sidebar-actions .mg-btn {
	width: 100%;
}

/* Sidebar footer with presets */
.mg-sidebar-footer {
	padding: 1rem 1.5rem;
	border-top: 1px solid var(--color-border);
	background: var(--color-overlay-dark);
	flex-shrink: 0;
}

.mg-sidebar-footer-section {
	margin-bottom: 1rem;
}

.mg-sidebar-footer-section:last-child {
	margin-bottom: 0;
}

.mg-sidebar-footer-label {
	font-size: 10px;
	font-weight: 600;
	color: var(--color-text-dimmed);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 0.5rem;
	font-family: 'Inter', sans-serif;
}

/* Preset dropdown */
.mg-preset-select {
	width: 100%;
	padding: 0.5rem 0.75rem;
	background-color: var(--color-bg-input);
	border: 1px solid var(--color-border);
	border-radius: 6px;
	color: var(--color-text-primary);
	font-size: 12px;
	font-family: 'Inter', sans-serif;
	cursor: pointer;
	transition: all 0.2s ease;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.75rem center;
	padding-right: 2rem;
}

.mg-preset-select:focus {
	outline: none;
	border-color: var(--color-accent-blue);
}

.mg-preset-select-wrapper {
	display: flex;
	gap: 0.5rem;
	align-items: center;
}

.mg-preset-select-wrapper .mg-preset-select {
	flex: 1;
}

.mg-preset-delete-btn {
	padding: 0.5rem;
	background: transparent;
	border: 1px solid var(--color-border-light);
	border-radius: 6px;
	color: var(--color-text-dimmed);
	cursor: pointer;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
}

.mg-preset-delete-btn:hover {
	border-color: #ef4444;
	color: #ef4444;
	background: rgba(239, 68, 68, 0.1);
}

.mg-preset-save-btn {
	width: 100%;
	padding: 0.5rem 0.75rem;
	background: transparent;
	border: 1px dashed var(--color-border-light);
	border-radius: 6px;
	color: var(--color-text-dimmed);
	font-size: 12px;
	font-family: 'Inter', sans-serif;
	cursor: pointer;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	margin-top: 0.5rem;
}

.mg-preset-save-btn:hover {
	border-color: var(--color-accent-blue);
	color: var(--color-accent-blue);
	background: rgba(74, 158, 255, 0.05);
}

/* Active preset indicator in header */
.mg-header-preset-indicator {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	padding: 0.25rem 0.625rem;
	background: rgba(168, 85, 247, 0.15);
	border: 1px solid rgba(168, 85, 247, 0.3);
	border-radius: 100px;
	font-size: 11px;
	font-weight: 500;
	color: #a855f7;
	margin-left: 0.5rem;
}

.mg-header-preset-indicator svg {
	width: 12px;
	height: 12px;
}

.mg-header-preset-indicator .mg-preset-clear {
	cursor: pointer;
	opacity: 0.7;
	transition: opacity 0.15s ease;
}

.mg-header-preset-indicator .mg-preset-clear:hover {
	opacity: 1;
}

/* Settings section */
.mg-filter-settings {
	padding: 1rem 1.5rem;
	border-top: 1px solid var(--color-border);
}

.mg-filter-settings-title {
	font-size: 10px;
	font-weight: 600;
	color: var(--color-text-hint);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 0.75rem;
	font-family: 'Inter', sans-serif;
}

/* Theme Toggle */
.mg-theme-toggle-wrapper {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 0.75rem;
	padding-top: 0.75rem;
	border-top: 1px solid var(--color-border);
}

.mg-theme-toggle-wrapper .mg-filter-label {
	font-size: 0.8rem;
	color: var(--color-text-secondary);
}

.mg-theme-toggle {
	display: flex;
	gap: 4px;
	background: var(--color-bg-primary);
	padding: 3px;
	border-radius: 6px;
}

.mg-theme-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 28px;
	border: none;
	background: transparent;
	color: var(--color-text-muted);
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.mg-theme-btn:hover {
	color: var(--color-text-primary);
	background: var(--color-overlay-light);
}

.mg-theme-btn.active {
	background: var(--color-accent-blue);
	color: #fff;
}

/* Theme toggle in footer */
.mg-theme-toggle-footer {
	margin-right: 1rem;
	background: var(--color-bg-secondary);
	padding: 2px;
	border-radius: 6px;
	border: 1px solid var(--color-border);
}

.mg-theme-toggle-footer .mg-theme-btn {
	width: 28px;
	height: 24px;
}

/* Active Filters Display (in sidebar - legacy) */
.mg-active-filters {
	display: none; /* Hidden - replaced by header chips */
}

.mg-active-filters h4 {
	margin: 0 0 0.75rem 0;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--color-text-secondary);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	font-family: 'Inter', sans-serif;
}

.mg-active-filters-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	min-height: 24px;
}

.mg-no-active-filters {
	font-size: 12px;
	color: var(--color-text-dimmed);
	font-style: italic;
}

.mg-active-filter-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.375rem 0.75rem;
	background: #2C2E34;
	border: 1px solid var(--color-border-light);
	border-radius: 6px;
	font-size: 12px;
	color: var(--color-text-primary);
}

.mg-active-filter-label {
	font-family: 'Inter', sans-serif;
}

.mg-active-filter-remove {
	background: none;
	border: none;
	color: var(--color-text-muted);
	cursor: pointer;
	font-size: 18px;
	line-height: 1;
	padding: 0;
	width: 18px;
	height: 18px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 3px;
	transition: all 0.2s ease;
}

.mg-active-filter-remove:hover {
	background: var(--color-border-light);
	color: var(--color-text-primary);
}

/* Header Chips - Active filters always visible in header */
.mg-header-chips {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-left: 1rem;
	padding-left: 1rem;
	border-left: 1px solid var(--color-border);
}

.mg-header-chips:empty {
	display: none;
}

.mg-header-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	padding: 0.25rem 0.5rem 0.25rem 0.625rem;
	background: rgba(74, 158, 255, 0.15);
	border: 1px solid rgba(74, 158, 255, 0.3);
	border-radius: 100px;
	font-size: 11px;
	color: var(--color-accent-blue);
	font-family: 'Inter', sans-serif;
	font-weight: 500;
	transition: all 0.15s ease;
	white-space: nowrap;
}

.mg-header-chip:hover {
	background: rgba(74, 158, 255, 0.25);
}

/* Different chip colors by type */
.mg-header-chip[data-type="status"] {
	background: rgba(74, 222, 128, 0.15);
	border-color: rgba(74, 222, 128, 0.3);
	color: #4ade80;
}

.mg-header-chip[data-type="project_lead"] {
	background: rgba(168, 85, 247, 0.15);
	border-color: rgba(168, 85, 247, 0.3);
	color: #a855f7;
}

.mg-header-chip[data-type="genre"] {
	background: rgba(251, 146, 60, 0.15);
	border-color: rgba(251, 146, 60, 0.3);
	color: #fb923c;
}

.mg-header-chip[data-type="service_fee"] {
	background: rgba(99, 102, 241, 0.15);
	border-color: rgba(99, 102, 241, 0.3);
	color: #6366f1;
}

/* Category chip styling (one chip per filter type) */
.mg-header-chip.mg-header-chip-category {
	cursor: pointer;
	padding: 0.25rem 0.5rem;
	gap: 0.25rem;
}

.mg-header-chip-label {
	font-size: 11px;
}

.mg-header-chip-badge {
	font-size: 10px;
	font-weight: 600;
	background: rgba(255, 255, 255, 0.2);
	padding: 0.125rem 0.375rem;
	border-radius: 100px;
	min-width: 18px;
	text-align: center;
}

.mg-header-chip[data-type="project_type"] .mg-header-chip-badge {
	background: rgba(74, 158, 255, 0.3);
}

.mg-header-chip[data-type="status"] .mg-header-chip-badge {
	background: rgba(74, 222, 128, 0.3);
}

.mg-header-chip[data-type="project_lead"] .mg-header-chip-badge {
	background: rgba(168, 85, 247, 0.3);
}

.mg-header-chip[data-type="genre"] .mg-header-chip-badge {
	background: rgba(251, 146, 60, 0.3);
}

/* Locked chip styling (when preset is active) */
.mg-header-chip.mg-header-chip-locked {
	cursor: not-allowed;
	opacity: 0.85;
	position: relative;
}

.mg-header-chip.mg-header-chip-locked::before {
	content: '';
	display: inline-block;
	width: 10px;
	height: 10px;
	margin-right: 2px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2' ry='2'%3E%3C/rect%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'%3E%3C/path%3E%3C/svg%3E");
	background-size: contain;
	background-repeat: no-repeat;
	opacity: 0.7;
}

.mg-header-chip.mg-header-chip-locked:hover {
	background: rgba(74, 158, 255, 0.15); /* No hover effect change */
}

.mg-header-chip.mg-header-chip-locked[data-type="status"]:hover {
	background: rgba(74, 222, 128, 0.15);
}

.mg-header-chip.mg-header-chip-locked[data-type="project_lead"]:hover {
	background: rgba(168, 85, 247, 0.15);
}

.mg-header-chip.mg-header-chip-locked[data-type="genre"]:hover {
	background: rgba(251, 146, 60, 0.15);
}

.mg-header-chip.mg-header-chip-locked[data-type="service_fee"]:hover {
	background: rgba(99, 102, 241, 0.15);
}

/* "+X meer" chip styling */
.mg-header-chip.mg-header-chip-more {
	background: rgba(255, 255, 255, 0.1);
	border-color: rgba(255, 255, 255, 0.2);
	color: var(--color-text-primary);
	cursor: pointer;
	padding: 0.25rem 0.625rem;
}

.mg-header-chip.mg-header-chip-more:hover {
	background: rgba(255, 255, 255, 0.2);
	border-color: rgba(255, 255, 255, 0.3);
}

.mg-header-chip-remove {
	background: none;
	border: none;
	color: inherit;
	cursor: pointer;
	padding: 0;
	width: 14px;
	height: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: all 0.15s ease;
	opacity: 0.7;
	font-size: 14px;
	line-height: 1;
}

.mg-header-chip-remove:hover {
	opacity: 1;
	background: rgba(255, 255, 255, 0.1);
}

.mg-header-chips-clear {
	font-size: 10px;
	color: var(--color-text-dimmed);
	background: none;
	border: none;
	cursor: pointer;
	padding: 0.25rem 0.5rem;
	border-radius: 4px;
	transition: all 0.2s ease;
	font-family: 'Inter', sans-serif;
	margin-left: 0.25rem;
}

.mg-header-chips-clear:hover {
	background: #2a2a2a;
	color: #ef4444;
}

/* Project Type Filters */
.mg-project-type-filters {
	display: flex;
	flex-direction: column;
}

.mg-project-type-filter-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	cursor: pointer;
	padding: 0.5rem;
	border-radius: 6px;
	transition: background 0.2s ease;
}

.mg-project-type-filter-item:hover {
	background: #23262B;
}

.mg-project-type-filter-checkbox {
	width: 18px;
	height: 18px;
	cursor: pointer;
	accent-color: var(--color-accent-blue);
	flex-shrink: 0;
}

.mg-project-type-filter-label {
	font-size: 13px;
	color: var(--color-text-primary);
	font-family: 'Inter', sans-serif;
	font-weight: 500;
	flex: 1;
}

.mg-project-type-filter-count {
	font-size: 12px;
	color: var(--color-text-muted);
	font-family: 'Inter', sans-serif;
}

/* Fullscreen mode */
body.mg-dashboard-page .site-header,
body.mg-dashboard-page .site-footer,
body.mg-dashboard-page .wp-block-template-part[data-type="core/template-part"][data-part="header"],
body.mg-dashboard-page .wp-block-template-part[data-type="core/template-part"][data-part="footer"],
body.mg-dashboard-page #wpadminbar {
	display: none !important;
}

body.mg-dashboard-page.admin-bar {
	margin-top: 0 !important;
}

body.mg-dashboard-page.admin-bar html {
	margin-top: 0 !important;
}

body.mg-dashboard-page {
	margin: 0 !important;
	padding: 0 !important;
}

.mg-dashboard-fullscreen {
	display: none;
}

/* Fixed Header */
.mg-dashboard-header-fixed {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	background: var(--color-bg-secondary);
	border-bottom: 1px solid var(--color-border);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
	z-index: 999;
	padding: 0;
}

.mg-dashboard-header-content {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1.5rem;
	max-width: 100%;
	padding: 1rem 1.5rem;
	min-height: 70px;
	box-sizing: border-box;
	height: auto;
}

.mg-dashboard-header-left {
	display: flex;
	align-items: center;
	gap: 1.5rem;
	flex: 1;
	min-width: 0; /* Allow flex items to shrink */
	flex-wrap: wrap;
}

.mg-dashboard-logo {
	max-height: 40px;
	width: auto;
	object-fit: contain;
	flex-shrink: 0;
	display: block;
	vertical-align: middle;
}

.mg-dashboard-header-left h1 {
	margin: 0;
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--color-text-primary);
	flex-shrink: 0;
	line-height: 1.2;
}

.mg-current-user {
	font-size: 0.875rem;
	color: var(--color-text-primary);
	font-family: 'Inter', sans-serif;
	font-weight: 500;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	white-space: nowrap;
	flex-shrink: 0;
	line-height: 1.5;
	vertical-align: middle;
	padding: 10px;
	background-color: var(--color-bg-card);
	border: 1px solid var(--color-border);
	border-radius: 5px;
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease;
}

.mg-current-user:hover {
	background-color: var(--color-bg-hover);
	border-color: var(--color-accent);
}

.mg-active-budget {
	font-size: 0.875rem;
	color: var(--color-text-secondary);
	font-family: 'Inter', sans-serif;
	white-space: nowrap;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	gap: 5px;
	line-height: 1.5;
	padding: 10px;
	background-color: var(--color-bg-card);
	border: 1px solid var(--color-border);
	border-radius: 5px;
}

.mg-active-budget-label {
	color: var(--color-text-secondary);
}

.mg-active-budget-name {
	color: var(--color-text-primary);
	font-weight: 500;
}

.mg-active-budget-year {
	color: var(--color-text-muted);
	font-size: 0.8rem;
}

.mg-last-updated {
	font-size: 0.875rem;
	color: var(--color-text-secondary);
	font-family: 'Inter', sans-serif;
	white-space: nowrap;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	gap: 5px;
	line-height: 1.5;
	padding: 10px;
	background-color: var(--color-bg-card);
	border: 1px solid var(--color-border);
	border-radius: 5px;
}

.mg-last-updated #mg-last-updated-time {
	color: var(--color-text-primary);
	font-weight: 500;
	font-family: 'JetBrains Mono', monospace;
}

.mg-refresh-icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: none;
	color: var(--color-text-secondary);
	cursor: pointer;
	padding: 4px;
	margin-left: 4px;
	border-radius: 4px;
	transition: all 0.2s ease;
}

.mg-refresh-icon-btn:hover {
	color: var(--color-text-primary);
	background: rgba(255, 255, 255, 0.1);
}

.mg-refresh-icon-btn:active {
	transform: scale(0.95);
}

.mg-refresh-icon-btn svg {
	display: block;
}

.mg-refresh-icon-btn.refreshing {
	pointer-events: none;
}

.mg-refresh-icon-btn.refreshing svg {
	animation: spin 1s linear infinite;
}

@keyframes spin {
	from {
		transform: rotate(0deg);
	}
	to {
		transform: rotate(360deg);
	}
}

.mg-dashboard-header-right {
	display: flex;
	align-items: center;
	gap: 1rem;
	flex-shrink: 0;
	flex-wrap: wrap;
}

.mg-version-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 0.75rem;
	background: var(--color-bg-card);
	border: 1px solid var(--color-border-light);
	border-radius: 6px;
	font-size: 0.75rem;
	color: var(--color-text-secondary);
	font-weight: 600;
	letter-spacing: 0.5px;
	transition: all 0.2s ease;
}

.mg-version-badge:hover {
	background: var(--color-bg-hover);
	border-color: var(--color-text-secondary);
	color: var(--color-text-primary);
}

.mg-version-text {
	font-family: 'JetBrains Mono', 'Courier New', monospace;
	font-variant-numeric: tabular-nums;
	font-size: 0.65rem;
	color: var(--color-text-muted);
}

.mg-version-badge .tooltip {
	display: inline-flex;
	align-items: center;
	cursor: help;
	color: var(--color-text-dimmed);
	transition: color 0.2s ease;
}

.mg-version-badge:hover .tooltip {
	color: var(--color-text-muted);
}

/* Beta Badge */
.mg-beta-badge {
	display: inline-block;
	background: linear-gradient(135deg, #f39c12, #e67e22);
	color: var(--color-text-primary);
	font-size: 9px;
	font-weight: 700;
	padding: 2px 6px;
	border-radius: 3px;
	margin-left: 5px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	vertical-align: middle;
	animation: mg-beta-pulse 2s ease-in-out infinite;
	cursor: help;
}

@keyframes mg-beta-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.7; }
}

.mg-btn-update {
	background: #4ade80 !important;
	border-color: #22c55e !important;
	color: #fff !important;
	font-weight: 600;
	animation: pulse 2s infinite;
}

.mg-btn-update:hover {
	background: #22c55e !important;
	border-color: #16a34a !important;
}

@keyframes pulse {
	0%, 100% {
		opacity: 1;
	}
	50% {
		opacity: 0.8;
	}
}

.mg-active-filters-indicator {
	display: flex;
	align-items: center;
}

.mg-filters-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 0.75rem;
	background: #2C2E34;
	border: 1px solid var(--color-border-light);
	border-radius: 6px;
	font-size: 0.875rem;
	color: var(--color-text-primary);
	font-family: 'Inter', sans-serif;
}

.mg-filters-icon {
	font-size: 1rem;
}

.mg-filters-text {
	font-weight: 500;
}

.mg-filters-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	background: #4a9eff;
	border-radius: 10px;
	font-size: 11px;
	font-weight: 600;
	color: var(--color-text-primary);
	font-family: 'Inter', sans-serif;
}

.mg-dashboard-header-right .mg-btn {
	white-space: nowrap;
	flex-shrink: 0;
}

.mg-dashboard-header-spacer {
	height: 70px;
	min-height: 70px;
	width: 100%;
	flex-shrink: 0;
}

/* Fixed Footer */
.mg-dashboard-footer-fixed {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	background: var(--color-bg-secondary);
	border-top: 1px solid var(--color-border);
	box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.3);
	z-index: 999;
	padding: 0;
}

.mg-dashboard-footer-content {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1.5rem;
	max-width: 100%;
	padding: 0.75rem 1.5rem;
	min-height: 56px;
	box-sizing: border-box;
}

.mg-dashboard-footer-left {
	display: flex;
	align-items: center;
	gap: 1rem;
	flex-shrink: 0;
}

.mg-dashboard-footer-center {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 1;
	gap: 1rem;
}

.mg-dashboard-footer-right {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-shrink: 0;
}

.mg-dashboard-footer-spacer {
	height: 70px;
	min-height: 70px;
	width: 100%;
	flex-shrink: 0;
}

/* Budget Selector in Footer */
.mg-budget-selector {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.mg-budget-selector label {
	font-size: 12px;
	color: var(--color-text-muted);
	font-weight: 500;
	white-space: nowrap;
}

.mg-footer-budget-select {
	padding: 0.5rem 2rem 0.5rem 0.75rem;
	background: var(--color-bg-card);
	border: 1px solid var(--color-border-light);
	border-radius: 6px;
	color: #e0e0e0;
	font-size: 13px;
	font-family: 'Inter', sans-serif;
	cursor: pointer;
	transition: all 0.2s ease;
	min-width: 200px;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.75rem center;
}

/* Budgets Button in Footer */
.mg-btn-budgets {
	display: flex;
	align-items: center;
	padding: 0.5rem 1rem;
	background: var(--color-bg-card);
	border: 1px solid var(--color-border-light);
	border-radius: 6px;
	color: #e0e0e0;
	font-size: 13px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.mg-btn-budgets:hover {
	border-color: var(--color-accent-blue);
	background: #2a2a2a;
}

.mg-budgets-count {
	background: #4a9eff;
	color: var(--color-text-primary);
	font-size: 11px;
	font-weight: 600;
	padding: 0.15rem 0.4rem;
	border-radius: 10px;
	margin-left: 0.5rem;
}

/* Budget Fly-in Panel */
.mg-budget-flyin {
	position: fixed;
	bottom: 56px;
	left: 0;
	right: 0;
	max-height: 0;
	background: var(--color-bg-secondary);
	border-top: 1px solid var(--color-border);
	box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
	z-index: 998;
	overflow: hidden;
	transition: max-height 0.3s ease-out;
}

.mg-budget-flyin.open {
	max-height: 60vh;
}

.mg-budget-flyin-content {
	display: flex;
	flex-direction: column;
	height: 100%;
	max-height: 60vh;
}

.mg-budget-flyin-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 1rem 1.5rem;
	border-bottom: 1px solid var(--color-border);
	flex-shrink: 0;
}

.mg-budget-flyin-header h3 {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	color: var(--color-text-primary);
}

.mg-budget-flyin-close {
	background: none;
	border: none;
	color: var(--color-text-muted);
	cursor: pointer;
	padding: 0.5rem;
	border-radius: 4px;
	transition: all 0.2s ease;
}

.mg-budget-flyin-close:hover {
	color: var(--color-text-primary);
	background: var(--color-overlay-light);
}

.mg-budget-flyin-body {
	flex: 1;
	overflow-y: auto;
	padding: 1rem 1.5rem;
}

/* Budget Cards */
.mg-budget-items-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 1rem;
}

.mg-budget-card {
	background: var(--color-bg-card);
	border: 1px solid var(--color-border-light);
	border-radius: 8px;
	padding: 1rem;
	transition: all 0.2s ease;
}

.mg-budget-card:hover {
	border-color: var(--color-text-secondary);
	background: #2a2a2a;
}

.mg-budget-card.active {
	border-color: var(--color-accent-blue);
	background: rgba(74, 158, 255, 0.1);
}

.mg-budget-card-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin-bottom: 0.5rem;
}

.mg-budget-card-title {
	font-size: 14px;
	font-weight: 600;
	color: var(--color-text-primary);
}

.mg-budget-card-title .mg-budget-title-edit {
	width: 100%;
	padding: 0.25rem 0.5rem;
	background: var(--color-bg-secondary);
	border: 1px solid #4a9eff;
	border-radius: 4px;
	color: var(--color-text-primary);
	font-size: 14px;
}

.mg-budget-card-badges {
	display: flex;
	gap: 0.5rem;
	align-items: center;
}

.mg-budget-card-meta {
	display: flex;
	gap: 1rem;
	font-size: 12px;
	color: var(--color-text-muted);
	margin-bottom: 0.75rem;
}

.mg-budget-card-meta .mg-budget-year-edit {
	padding: 0.15rem 0.5rem;
	background: var(--color-bg-secondary);
	border: 1px solid #4a9eff;
	border-radius: 4px;
	color: var(--color-text-primary);
	font-size: 12px;
}

.mg-budget-card-actions {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.mg-btn-small {
	padding: 0.3rem 0.6rem !important;
	font-size: 11px !important;
	min-width: auto !important;
}

.mg-budget-empty {
	text-align: center;
	padding: 2rem;
	color: var(--color-text-muted);
}

.mg-budget-empty p {
	margin: 0.5rem 0;
}

/* Ghost tile for new budget */
.mg-budget-card-ghost {
	background: transparent;
	border: 2px dashed var(--color-border-light);
	border-radius: 8px;
	padding: 1rem;
	min-height: 100px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.2s ease;
}

.mg-budget-card-ghost:hover {
	border-color: var(--color-accent-blue);
	background: rgba(74, 158, 255, 0.05);
}

.mg-budget-card-ghost:hover .mg-budget-card-ghost-content {
	color: var(--color-accent-blue);
}

.mg-budget-card-ghost-content {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
	color: var(--color-text-dimmed);
	transition: color 0.2s ease;
}

.mg-budget-card-ghost-content svg {
	opacity: 0.7;
}

.mg-budget-card-ghost-content span {
	font-size: 13px;
	font-weight: 500;
}

/* Modal Overlay */
.mg-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.7);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10001;
	backdrop-filter: blur(4px);
}

.mg-modal {
	background: var(--color-bg-secondary);
	border: 1px solid var(--color-border-light);
	border-radius: 12px;
	width: 90%;
	max-width: 480px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
	animation: mg-modal-appear 0.2s ease-out;
}

/* Refresh modal specific styling (override later conflicting styles from permissions modal) */
.mg-modal-overlay .mg-refresh-modal-content {
	/* Reset position properties that conflict with permissions modal */
	position: static !important;
	left: auto !important;
	top: auto !important;
	width: 90% !important;
	max-width: 480px !important;
	height: auto !important;

	/* Restore original modal styling */
	background: var(--color-bg-secondary) !important;
	border: 1px solid var(--color-border-light) !important;
	border-radius: 12px !important;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important;

	/* Remove flexbox properties from permissions modal */
	display: block !important;
	align-items: initial !important;
	justify-content: initial !important;
	backdrop-filter: none !important;
	padding: 0 !important;
}

/* Restore original styling for refresh modal child elements */
.mg-modal-overlay .mg-refresh-modal-content .mg-modal-header {
	padding: 1.25rem 1.5rem !important;
	border-bottom: 1px solid var(--color-border) !important;
	display: flex !important;
	justify-content: space-between !important;
	align-items: center !important;
}

.mg-modal-overlay .mg-refresh-modal-content .mg-modal-header h3 {
	margin: 0 !important;
	font-size: 16px !important;
	font-weight: 600 !important;
	color: var(--color-text-primary) !important;
}

.mg-modal-overlay .mg-refresh-modal-content .mg-modal-body {
	padding: 1.5rem !important;
}

.mg-modal-overlay .mg-refresh-modal-content .mg-modal-close {
	background: none !important;
	border: none !important;
	color: var(--color-text-muted) !important;
	cursor: pointer !important;
	padding: 0.25rem !important;
	border-radius: 4px !important;
	transition: all 0.2s ease !important;
	width: auto !important;
	height: auto !important;
	font-size: inherit !important;
}

.mg-modal-overlay .mg-refresh-modal-content .mg-modal-close:hover {
	color: var(--color-text-primary) !important;
	background: rgba(255, 255, 255, 0.1) !important;
}

.mg-modal-overlay .mg-refresh-modal-content .mg-modal-footer {
	display: flex !important;
	justify-content: flex-end !important;
	gap: 0.75rem !important;
	padding: 1rem 1.5rem !important;
	border-top: 1px solid var(--color-border) !important;
	background: rgba(0, 0, 0, 0.2) !important;
	border-radius: 0 0 12px 12px !important;
}

@keyframes mg-modal-appear {
	from {
		opacity: 0;
		transform: scale(0.95) translateY(-10px);
	}
	to {
		opacity: 1;
		transform: scale(1) translateY(0);
	}
}

.mg-modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 1.25rem 1.5rem;
	border-bottom: 1px solid var(--color-border);
}

.mg-modal-header h3 {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	color: var(--color-text-primary);
}

.mg-modal-close {
	background: none;
	border: none;
	color: var(--color-text-muted);
	cursor: pointer;
	padding: 0.25rem;
	border-radius: 4px;
	transition: all 0.2s ease;
}

.mg-modal-close:hover {
	color: var(--color-text-primary);
	background: rgba(255, 255, 255, 0.1);
}

.mg-modal-body {
	padding: 1.5rem;
}

.mg-modal-info {
	margin: 0 0 1rem 0;
	color: var(--color-text-muted);
	font-size: 13px;
	line-height: 1.5;
}

.mg-modal-sources {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.mg-modal-source {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 0.5rem;
	padding: 0.75rem 1rem;
	background: var(--color-bg-card);
	border-radius: 8px;
	border: 1px solid var(--color-border-light);
}

.mg-modal-source-dot {
	font-size: 1rem;
	line-height: 1;
}

.mg-modal-source-name {
	font-size: 13px;
	font-weight: 500;
	color: var(--color-text-primary);
}

.mg-modal-source-info {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.15rem;
}

.mg-modal-source-time {
	font-size: 12px;
	color: #aaa;
}

.mg-modal-source-next {
	font-size: 11px;
	color: var(--color-text-muted);
}

.mg-modal-source-error {
	font-size: 11px;
	color: #ef4444;
	margin-top: 0.25rem;
}

.mg-modal-footer {
	display: flex;
	justify-content: flex-end;
	gap: 0.75rem;
	padding: 1rem 1.5rem;
	border-top: 1px solid var(--color-border);
	background: rgba(0, 0, 0, 0.2);
	border-radius: 0 0 12px 12px;
}

/* Filter Section */

.mg-dashboard-header {
	margin-bottom: 2rem;
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 1.5rem;
	padding: 1.5rem;
	background: var(--color-bg-secondary);
	border-radius: 12px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
	border: 1px solid var(--color-border);
}

.mg-dashboard-header h1 {
	margin: 0;
	font-size: 2rem;
	font-weight: 700;
	color: var(--color-text-primary);
}

.mg-dashboard-stats {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	margin-bottom: 2rem;
}

.mg-dashboard-stats-row {
	display: flex;
	gap: 1.5rem;
	width: 100%;
}

/* Stats tile grouping (e.g. Bezoekers: verwacht/begroot/verschil) */
.mg-stat-group {
	display: flex;
	flex-direction: column;
	gap: 0; /* no whitespace between header and tiles */
	flex: 3 1 0;
	min-width: 0;
}

/* Give the 4-column Horeca group more horizontal room than Bezoekers */
.mg-stat-group[data-group="horeca"] {
	flex: 4 1 0;
}

/* Give the 4-column Tickets group more horizontal room than Bezoekers */
.mg-stat-group[data-group="tickets"] {
	flex: 4 1 0;
}

.mg-stat-group-header {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	font-size: 0.75rem;
	color: var(--color-text-secondary);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	font-weight: 600;
	font-family: 'Inter', sans-serif;
	padding: 0.45rem 0.75rem;
	border-radius: 12px 12px 0 0; /* visually connects to tiles row */
	background: var(--color-bg-card);
	border: none; /* tiles have no border */
	/* subtle visual tie-in with tiles */
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.mg-stat-group-header::after {
	display: none; /* no divider line between header and tiles */
}

.mg-stat-group-header-title {
	flex: 1;
}

/* Total revenue filter toggle chip */
.mg-totaal-filter-toggle {
	display: flex;
	align-items: center;
	cursor: pointer;
	margin-left: 0.75rem;
}

.mg-totaal-filter-toggle input[type="checkbox"] {
	display: none;
}

.mg-totaal-filter-chip {
	display: inline-flex;
	align-items: center;
	padding: 0.2rem 0.5rem;
	font-size: 0.65rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	border-radius: 4px;
	background: var(--color-bg-tertiary);
	color: var(--color-text-secondary);
	border: 1px solid var(--color-border);
	transition: all 0.2s ease;
	user-select: none;
}

.mg-totaal-filter-toggle input[type="checkbox"]:checked + .mg-totaal-filter-chip {
	background: var(--color-accent);
	color: #fff;
	border-color: var(--color-accent);
}

.mg-totaal-filter-chip:hover {
	opacity: 0.85;
}

.mg-stat-group-tiles {
	display: flex;
	gap: 1.5rem;
	width: 100%;
	min-width: 0;
	overflow-anchor: none; /* Prevent scroll anchoring warnings from font-size animations */
}

.mg-stat-group-tiles .mg-stat-tile {
	flex: 1 1 0;
	min-width: 0;
	border-top-left-radius: 0;
	border-top-right-radius: 0;
}


.mg-stat-tile {
	background: var(--color-bg-card);
	border: none;
	border-radius: 12px;
	padding: 1.5rem;
	box-shadow: 0 2px 8px var(--color-shadow);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	position: relative;
	overflow: hidden;
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	flex-direction: column;
	/* Dynamic value scaling (JS will shrink within these bounds) */
	--mg-tile-value-max-font: 1.75rem;
	--mg-tile-value-min-font: 1.0rem;
}

.mg-stat-tile::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	background: var(--tile-accent-color, transparent);
	z-index: 1;
}

.mg-stat-tile:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.mg-stat-tile h3 {
	margin: 0 0 0.75rem 0;
	font-size: 0.75rem;
	color: #B0B5BD;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	font-weight: 500;
	font-family: 'Inter', sans-serif;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.mg-stat-tile h3 .mg-stat-title-meta {
	color: rgba(176, 181, 189, 0.75);
	font-size: 0.85em;
	font-weight: 500;
	letter-spacing: 0.2px;
	text-transform: none;
	white-space: nowrap;
}

.mg-tile-toggle {
	position: absolute;
	top: 10px;
	right: 12px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.7rem;
	color: rgba(176, 181, 189, 0.85);
	text-transform: uppercase;
	letter-spacing: 0.4px;
	font-weight: 600;
	font-family: 'Inter', sans-serif;
	user-select: none;
	z-index: 5;
}

.mg-tile-toggle input[type="checkbox"] {
	width: 14px;
	height: 14px;
	accent-color: var(--color-accent-blue);
	cursor: pointer;
}

.mg-tile-toggle span {
	cursor: pointer;
}

.mg-stat-tile .value {
	font-size: var(--mg-tile-value-max-font, 1.75rem);
	font-weight: 700;
	color: #4285F4;
	margin: 0;
	line-height: 1.2;
	font-family: 'JetBrains Mono', monospace;
	white-space: nowrap; /* prevent € and amount from wrapping */
	overflow-wrap: normal;
	word-break: keep-all;
	transition: font-size 0.3s ease-out;
}

.mg-stat-tile .value.value-green {
	color: #34A853;
}

/* Horeca group: 4 tiles → slightly smaller values to avoid wrapping */
.mg-stat-group[data-group="horeca"] .mg-stat-tile {
	--mg-tile-value-max-font: 1.55rem;
}

/* Tickets group: 4 tiles → slightly smaller values to avoid wrapping */
.mg-stat-group[data-group="tickets"] .mg-stat-tile {
	--mg-tile-value-max-font: 1.55rem;
}

.mg-stat-tile .value.value-positive {
	color: #34A853;
}

.mg-stat-tile .value.value-negative {
	color: #EA4335;
}

.mg-stat-tile .value.value-large {
	font-size: var(--mg-tile-value-max-font, 1.75rem);
	white-space: nowrap;
	overflow-wrap: normal;
	word-break: keep-all;
}

/* Double value tile (gewogen + ongewogen, verwacht + gegarandeerd) */
.mg-stat-tile-double {
	--mg-tile-value-max-font: 1.35rem;
	--mg-tile-value-min-font: 0.9rem;
}

.mg-stat-tile-double .value {
	font-size: 1rem;
	margin: 2px 0;
	display: flex;
	align-items: center;
	gap: 6px;
}

.mg-stat-tile-double .value-label {
	font-size: 0.65rem;
	font-weight: 400;
	color: var(--color-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.02em;
	min-width: 75px;
	flex-shrink: 0;
}

.mg-stat-tile-double .value-amount {
	font-size: var(--mg-tile-value-max-font, 1.35rem);
	font-weight: 700;
	color: #4285F4;
	font-family: 'JetBrains Mono', monospace;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: clip;
	flex: 1;
	min-width: 0;
}

.mg-stat-tile-double .value-label .tooltip-info {
	border-bottom: 1px dashed #888;
	cursor: help;
}

/* Bezoekers verwacht tile - taxatie and live values */
.mg-stat-tile-double .value-taxatie .value-amount {
	color: var(--color-text-muted);
}

.mg-stat-tile-double .value-live .value-amount {
	color: #16a34a; /* Green for "live" actual data */
}

/* Light theme adjustments for bezoekers values */
body.mg-dashboard-page.theme-light .mg-stat-tile-double .value-taxatie .value-amount {
	color: var(--color-text-secondary);
}

body.mg-dashboard-page.theme-light .mg-stat-tile-double .value-live .value-amount {
	color: #15803d; /* Darker green for light mode */
}

/* Split value tile (main value + sub values on right) */
.mg-stat-tile-split .mg-stat-split-layout {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.mg-stat-tile-split .value-main {
	font-size: 1.5rem;
	font-weight: 700;
	margin: 0;
}

.mg-stat-tile-split .value-sub-group {
	display: flex;
	flex-direction: column;
	gap: 2px;
	border-left: 1px solid var(--color-border-light);
	padding-left: 10px;
}

.mg-stat-tile-split .value-sub {
	font-size: 0.75rem;
	margin: 0;
	display: flex;
	align-items: center;
	gap: 4px;
}

.mg-stat-tile-split .value-sub .value-label {
	font-size: 0.6rem;
	font-weight: 400;
	color: var(--color-text-muted);
	text-transform: uppercase;
	letter-spacing: 0.02em;
	min-width: 45px;
}

.mg-stat-tile-split .value-sub .value-amount {
	font-weight: 600;
}

.mg-stat-tile-split .value-count {
	display: block;
	font-size: 0.6rem;
	font-weight: 400;
	color: var(--color-text-muted);
	line-height: 1.2;
}

.mg-stat-tile-split .value-count-algemeen {
	margin-top: -2px;
}

.mg-stat-tile-split .value-sub .value-count {
	display: inline;
	margin-left: 4px;
	font-size: 0.55rem;
}

/* Large total tile */
.mg-stat-tile-large {
	flex: 1.5;
	min-width: 180px;
}

.mg-stat-tile-large .value-totaal {
	font-size: 2rem;
	font-weight: 700;
	color: #4ade80;
}

/* Breakdown tile (subtotal with line items) */
.mg-stat-tile-breakdown {
	flex: 1;
}

.mg-stat-tile-breakdown .value-subtotaal {
	font-size: 1.25rem !important;
	font-weight: 700;
	margin-bottom: 6px;
	color: #4a9eff;
}

.mg-stat-tile-breakdown .value-breakdown {
	display: flex;
	flex-direction: column;
	gap: 2px;
	border-top: 1px solid var(--color-border-light);
	padding-top: 6px;
	margin-top: 4px;
}

.mg-stat-tile-breakdown .breakdown-item {
	display: flex;
	align-items: center;
	gap: 4px;
	font-size: 0.7rem !important;
}

.mg-stat-tile-breakdown .breakdown-label {
	font-size: 0.65rem !important;
	color: var(--color-text-muted);
	font-weight: 400;
	min-width: 70px;
}

.mg-stat-tile-breakdown .breakdown-value {
	font-size: 0.7rem !important;
	font-weight: 600;
	font-family: 'JetBrains Mono', monospace;
	color: var(--color-text);
}

/* Tile accent colors for top border */
.mg-stat-tile[data-tile="unieke_evenementen"] {
	--tile-accent-color: #FF6B6B;
}

.mg-stat-tile[data-tile="bezoekers_verwacht"] {
	--tile-accent-color: #4ECDC4;
}

.mg-stat-tile[data-tile="tickets_verkocht"] {
	--tile-accent-color: #9C27B0;
}

.mg-stat-tile[data-tile="bevestigd"] {
	--tile-accent-color: #F4B400;
}

.mg-stat-tile[data-tile="opties"] {
	--tile-accent-color: #5C9BD1;
}

.mg-stat-tile[data-tile="tbc"] {
	--tile-accent-color: #FF9800;
}

.mg-stat-tile[data-tile="begroot"] {
	--tile-accent-color: #4285F4;
}

.mg-stat-tile[data-tile="verschil"] {
	--tile-accent-color: #9C27B0;
}

.mg-stat-tile[data-tile="horeca_begroot"] {
	--tile-accent-color: #F4B400;
}

.mg-stat-tile[data-tile="horeca_realisatie"] {
	--tile-accent-color: #FF9800;
}

.mg-stat-tile[data-tile="horeca_verschil"] {
	--tile-accent-color: #EA4335;
}

.mg-stat-tile[data-tile="service_fee_totaal"] {
	--tile-accent-color: #4CAF50;
}

.mg-stat-tile[data-tile="tickets_gerealiseerd_verschil"] {
	--tile-accent-color: #9E9E9E;
}

.mg-stat-tile[data-tile="totaal_omzet"] {
	--tile-accent-color: #4ade80;
}

.mg-stat-tile[data-tile="totaal_tickets_omzet"] {
	--tile-accent-color: #60a5fa;
}

.mg-stat-tile[data-tile="totaal_horeca_omzet"] {
	--tile-accent-color: #f97316;
}

.mg-stat-tile .tooltip,
.mg-dashboard-table .tooltip {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-left: 0.5rem;
	cursor: help;
	font-size: 0.875rem;
	color: #4285F4;
	transition: color 0.2s ease;
	z-index: 100;
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

.mg-stat-tile .tooltip svg,
.mg-dashboard-table .tooltip svg {
	width: 100%;
	height: 100%;
	display: block;
}

.mg-stat-tile .tooltip:hover,
.mg-dashboard-table .tooltip:hover {
	color: #5998D6;
}

/* Tooltip Popup - width set dynamically via JavaScript based on content */
.mg-tooltip-popup {
	position: fixed;
	background: var(--color-bg-tertiary);
	border: 1px solid var(--color-border-light);
	border-radius: 8px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
	z-index: 10000;
	pointer-events: auto;
	transition: opacity 0.2s ease;
	cursor: default;
	min-width: 400px;
}

.mg-tooltip-content {
	padding: 12px 16px;
	color: var(--color-text-primary);
	font-size: 0.875rem;
	line-height: 1.6;
	font-family: 'Inter', sans-serif;
	max-height: 400px;
	overflow-y: auto;
	overflow-x: hidden;
	word-wrap: break-word;
	white-space: pre-line;
}

.mg-tooltip-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.mg-tooltip-list li {
	padding: 4px 0;
	border-bottom: 1px solid var(--color-overlay-light);
}

.mg-tooltip-list li:last-child {
	border-bottom: none;
}

/* Filter chips tooltip */
.mg-tooltip-filter-chips .mg-tooltip-content {
	padding: 0.5rem;
}

.mg-tooltip-chips-container {
	display: flex;
	flex-wrap: wrap;
	gap: 0.375rem;
	max-width: 300px;
}

/* Base chip styles */
.mg-tooltip-chip {
	display: inline-flex;
	align-items: center;
	padding: 0.25rem 0.5rem;
	border-radius: 100px;
	font-size: 11px;
	font-weight: 500;
	white-space: nowrap;
	border: 1px solid;
	cursor: pointer;
	transition: all 0.15s ease;
}

.mg-tooltip-chip:hover {
	transform: scale(1.02);
}

/* Inactive (unselected) chip state - grey */
.mg-tooltip-chip.inactive {
	background: rgba(128, 128, 128, 0.15);
	color: var(--color-text-muted);
	border-color: rgba(128, 128, 128, 0.25);
}

.mg-tooltip-chip.inactive:hover {
	background: rgba(128, 128, 128, 0.25);
	color: var(--color-text-secondary);
}

/* Active chip colors by type */
.mg-tooltip-chip.active {
	background: rgba(74, 158, 255, 0.2);
	color: var(--color-accent-blue);
	border-color: rgba(74, 158, 255, 0.3);
}

.mg-tooltip-chip.active[data-filter-type="status"] {
	background: rgba(74, 222, 128, 0.2);
	color: #4ade80;
	border-color: rgba(74, 222, 128, 0.3);
}

.mg-tooltip-chip.active[data-filter-type="project_lead"] {
	background: rgba(168, 85, 247, 0.2);
	color: #a855f7;
	border-color: rgba(168, 85, 247, 0.3);
}

.mg-tooltip-chip.active[data-filter-type="genre"] {
	background: rgba(251, 146, 60, 0.2);
	color: #fb923c;
	border-color: rgba(251, 146, 60, 0.3);
}

/* Locked tooltip chip styling (when preset is active) */
.mg-tooltip-chip.mg-tooltip-chip-locked {
	cursor: not-allowed;
	opacity: 0.7;
}

.mg-tooltip-chip.mg-tooltip-chip-locked::before {
	content: '';
	display: inline-block;
	width: 10px;
	height: 10px;
	margin-right: 4px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2' ry='2'%3E%3C/rect%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'%3E%3C/path%3E%3C/svg%3E");
	background-size: contain;
	background-repeat: no-repeat;
	opacity: 0.6;
}

.mg-tooltip-chip.mg-tooltip-chip-locked:hover {
	transform: none;
}

/* Opties tooltip: searchable list + new-event highlight (test) */
.mg-tooltip-opties .mg-tooltip-content {
	display: flex;
	flex-direction: column;
	padding: 8px 12px;
}

.mg-tooltip-opties-search {
	margin-bottom: 8px;
	flex-shrink: 0;
}

.mg-tooltip-opties-search-input {
	width: 100%;
	padding: 6px 10px;
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 6px;
	background: rgba(0, 0, 0, 0.2);
	color: var(--color-text-primary);
	font-size: 0.9em;
	outline: none;
	box-sizing: border-box;
}

.mg-tooltip-opties-search-input::placeholder {
	color: var(--color-text-muted);
}

.mg-tooltip-opties-search-input:focus {
	border-color: rgba(74, 158, 255, 0.5);
}

.mg-tooltip-opties-list {
	display: flex;
	flex-direction: column;
	max-height: 280px;
	overflow-y: auto;
}

.mg-tooltip-opties-row {
	padding: 5px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	font-size: 0.9em;
}

.mg-tooltip-opties-row:last-child {
	border-bottom: none;
}

.mg-tooltip-table-body {
	max-height: 280px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
}

.mg-tooltip-opties-row-inner {
	display: block;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

body.mg-dashboard-page.theme-light .mg-tooltip-opties-search-input {
	border-color: rgba(0, 0, 0, 0.2);
	background: rgba(255, 255, 255, 0.8);
}

body.mg-dashboard-page.theme-light .mg-tooltip-opties-search-input:focus {
	border-color: rgba(74, 158, 255, 0.6);
}

/* New event highlight: fades out over ~4 seconds */
.mg-tooltip-event-new {
	animation: mg-tooltip-event-new 4s ease-out forwards;
}

@keyframes mg-tooltip-event-new {
	0% {
		background: rgba(74, 222, 128, 0.35);
	}
	100% {
		background: transparent;
	}
}

/* Event table (opties, bevestigd, tbc): same layout as ticket omzet */
.mg-tooltip-event-table .mg-tooltip-event-table-wrap {
	display: flex;
	flex-direction: column;
}

.mg-tooltip-event-table .mg-tooltip-event-table-row {
	display: flex;
	gap: 8px;
	align-items: center;
	padding: 4px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mg-tooltip-event-table .mg-tooltip-event-table-row:last-child {
	border-bottom: none;
}

.mg-tooltip-event-table .mg-tooltip-event-table-head {
	font-weight: 600;
	font-size: 0.75em;
	color: var(--color-text-muted);
	border-bottom: 1px solid rgba(255, 255, 255, 0.18);
	padding-bottom: 6px;
	margin-bottom: 2px;
}

.mg-tooltip-event-table .mg-tooltip-event-table-date {
	flex: 0 0 70px;
	color: var(--color-text-muted);
	font-size: 0.75em;
	white-space: nowrap;
}

.mg-tooltip-event-table .mg-tooltip-event-table-title {
	flex: 1 1 0;
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mg-tooltip-event-table .mg-tooltip-event-table-type {
	flex: 0 0 auto;
	flex-shrink: 0;
	text-align: right;
	white-space: nowrap;
}

.mg-tooltip-event-table .mg-tooltip-event-table-type .mg-project-type-badge {
	margin-left: 0;
}

/* Horeca tooltip layout: date | event | amount */
.mg-tooltip-events,
.mg-tooltip-horeca {
	display: flex;
	flex-direction: column;
}

.mg-tooltip-events-row,
.mg-tooltip-horeca-row {
	display: flex;
	gap: 10px;
	align-items: center;
	padding: 6px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	width: 100%;
}


.mg-tooltip-events-row:last-child,
.mg-tooltip-horeca-row:last-child {
	border-bottom: none;
}

.mg-tooltip-events-status {
	flex: 0 0 16px;
	text-align: center;
	font-size: 1em;
}

.mg-tooltip-events-date,
.mg-tooltip-horeca-date {
	flex: 0 0 75px;
	color: var(--color-text-muted);
	font-size: 0.85em;
	white-space: nowrap;
}

.mg-tooltip-events-title,
.mg-tooltip-horeca-title {
	flex: 1 1 0;
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mg-tooltip-events-amount,
.mg-tooltip-horeca-amount {
	flex: 0 0 auto;
	flex-shrink: 0;
	text-align: right;
	margin-left: 12px;
	white-space: nowrap;
	font-family: 'JetBrains Mono', monospace;
	font-variant-numeric: tabular-nums;
}

/* Tickets gerealiseerd tooltip: extra columns Taxatie | Verkocht (green/red by value) */
.mg-tooltip-tickets-head {
	font-weight: 600;
	font-size: 0.75em;
	color: var(--color-text-muted);
	border-bottom: 1px solid var(--color-border);
}

/* Fixed width for number columns so header and data align (Taxatie, Verkocht, € Omzet) */
.mg-tooltip-tickets-taxatie,
.mg-tooltip-tickets-sold {
	flex: 0 0 56px;
	min-width: 56px;
	text-align: right;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.mg-tooltip-tickets-head .mg-tooltip-tickets-taxatie,
.mg-tooltip-tickets-head .mg-tooltip-tickets-sold,
.mg-tooltip-tickets-head .mg-tooltip-events-amount {
	text-align: right;
}

/* Expected revenue tooltip (verwachte_ticket_omzet): 6 columns (Status | Datum | Evenement | Aantal | Ticketprijs | Totaal) */
.mg-tooltip-expected {
	display: flex;
	flex-direction: column;
}

.mg-tooltip-expected-row {
	display: flex;
	gap: 8px;
	align-items: center;
	padding: 4px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mg-tooltip-expected-row:last-child {
	border-bottom: none;
}

.mg-tooltip-expected-head {
	font-weight: 600;
	font-size: 0.75em;
	color: var(--color-text-muted);
	border-bottom: 1px solid rgba(255, 255, 255, 0.18);
	padding-bottom: 6px;
	margin-bottom: 2px;
}

.mg-tooltip-expected-status {
	flex: 0 0 24px;
	text-align: center;
	font-size: 1em;
	line-height: 1;
}

.mg-tooltip-expected-date {
	flex: 0 0 70px;
	color: var(--color-text-muted);
	font-size: 0.75em;
	white-space: nowrap;
}

.mg-tooltip-expected-title {
	flex: 1 1 auto;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	min-width: 0;
}

.mg-tooltip-expected-visitors,
.mg-tooltip-expected-price,
.mg-tooltip-expected-total {
	flex: 0 0 auto;
	text-align: right;
	white-space: nowrap;
	font-family: 'JetBrains Mono', monospace;
	font-variant-numeric: tabular-nums;
}

.mg-tooltip-expected-visitors {
	width: 72px;
}

.mg-tooltip-expected-price {
	width: 92px;
}

.mg-tooltip-expected-total {
	width: 100px;
}

/* Estimated price indicators (fallback for events without ticket price) */
.mg-avg-price {
	color: #f59e0b;
	font-style: italic;
}

.mg-matched-price {
	color: #3b82f6;
	font-style: italic;
}

body.mg-dashboard-page.theme-light .mg-avg-price {
	color: #d97706;
}

body.mg-dashboard-page.theme-light .mg-matched-price {
	color: #2563eb;
}

/* No-show tooltip: 5 columns (Datum | Evenement | Verkocht | No show | %) */
.mg-tooltip-noshow {
	display: flex;
	flex-direction: column;
}

.mg-tooltip-noshow-row {
	display: flex;
	gap: 8px;
	align-items: center;
	padding: 4px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mg-tooltip-noshow-row:last-child {
	border-bottom: none;
}

.mg-tooltip-noshow-head {
	font-weight: 600;
	font-size: 0.75em;
	color: var(--color-text-muted);
	border-bottom: 1px solid rgba(255, 255, 255, 0.18);
	padding-bottom: 6px;
	margin-bottom: 2px;
}

.mg-tooltip-noshow-date {
	flex: 0 0 70px;
	color: var(--color-text-muted);
	font-size: 0.75em;
	white-space: nowrap;
}

.mg-tooltip-noshow-title {
	flex: 1 1 0;
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mg-tooltip-noshow-verkocht,
.mg-tooltip-noshow-noshow,
.mg-tooltip-noshow-pct {
	flex: 0 0 auto;
	flex-shrink: 0;
	text-align: right;
	white-space: nowrap;
	font-family: 'JetBrains Mono', monospace;
	font-variant-numeric: tabular-nums;
}

.mg-tooltip-noshow-verkocht {
	min-width: 55px;
}

.mg-tooltip-noshow-noshow {
	min-width: 55px;
}

.mg-tooltip-noshow-pct {
	min-width: 50px;
}

/* Taxatie tooltip: 4 columns (Datum | Evenement | Taxatie | Gescand) */
.mg-tooltip-taxatie {
	display: flex;
	flex-direction: column;
}

.mg-tooltip-taxatie-row {
	display: flex;
	gap: 8px;
	align-items: center;
	padding: 4px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mg-tooltip-taxatie-row:last-child {
	border-bottom: none;
}

.mg-tooltip-taxatie-head {
	font-weight: 600;
	font-size: 0.75em;
	color: var(--color-text-muted);
	border-bottom: 1px solid rgba(255, 255, 255, 0.18);
	padding-bottom: 6px;
	margin-bottom: 2px;
}

.mg-tooltip-taxatie-date {
	flex: 0 0 70px;
	color: var(--color-text-muted);
	font-size: 0.75em;
	white-space: nowrap;
}

.mg-tooltip-taxatie-title {
	flex: 1 1 0;
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mg-tooltip-taxatie-taxatie,
.mg-tooltip-taxatie-gescand {
	flex: 0 0 auto;
	flex-shrink: 0;
	text-align: right;
	white-space: nowrap;
	font-family: 'JetBrains Mono', monospace;
	font-variant-numeric: tabular-nums;
	min-width: 60px;
}

/* Ticket omzet tooltip: 4 columns (Datum | Evenement | Tickets | Omzet) */
.mg-tooltip-ticket-omzet {
	display: flex;
	flex-direction: column;
}

.mg-tooltip-ticket-omzet-row {
	display: flex;
	gap: 8px;
	align-items: center;
	padding: 4px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mg-tooltip-ticket-omzet-row:last-child {
	border-bottom: none;
}

.mg-tooltip-ticket-omzet-head {
	font-weight: 600;
	font-size: 0.75em;
	color: var(--color-text-muted);
	border-bottom: 1px solid rgba(255, 255, 255, 0.18);
	padding-bottom: 6px;
	margin-bottom: 2px;
}

.mg-tooltip-ticket-omzet-date {
	flex: 0 0 70px;
	color: var(--color-text-muted);
	font-size: 0.75em;
	white-space: nowrap;
}

.mg-tooltip-ticket-omzet-title {
	flex: 1 1 0;
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mg-tooltip-ticket-omzet-taxatie,
.mg-tooltip-ticket-omzet-total,
.mg-tooltip-ticket-omzet-tickets,
.mg-tooltip-ticket-omzet-amount {
	flex: 0 0 auto;
	flex-shrink: 0;
	text-align: right;
	white-space: nowrap;
	font-family: 'JetBrains Mono', monospace;
	font-variant-numeric: tabular-nums;
}

.mg-tooltip-ticket-omzet-taxatie {
	min-width: 55px;
}

.mg-tooltip-ticket-omzet-total {
	min-width: 70px;
}

.mg-tooltip-ticket-omzet-tickets {
	min-width: 60px;
}

.mg-tooltip-ticket-omzet-amount {
	min-width: 85px;
}

/* Sold out badge */
.mg-sold-out-badge {
	display: inline-block;
	background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
	color: #000;
	font-size: 0.6em;
	font-weight: 700;
	padding: 2px 5px;
	border-radius: 3px;
	margin-left: 6px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	vertical-align: middle;
	white-space: nowrap;
}

/* Free event badge */
.mg-free-badge {
	display: inline-block;
	background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
	color: var(--color-text-primary);
	font-size: 0.6em;
	font-weight: 700;
	padding: 2px 5px;
	border-radius: 3px;
	margin-left: 6px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	vertical-align: middle;
	white-space: nowrap;
}

/* Tag-based data badge */
.mg-tag-badge {
	display: inline-block;
	background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
	color: var(--color-text-primary);
	font-size: 0.6em;
	font-weight: 700;
	padding: 2px 5px;
	border-radius: 3px;
	margin-left: 6px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	vertical-align: middle;
	white-space: nowrap;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.mg-tooltip-arrow {
	position: absolute;
	width: 0;
	height: 0;
	border: 6px solid transparent;
}

/* Laatst bijgewerkt tooltip - special styling */
.mg-tooltip-last-updated {
	min-width: 300px;
	max-width: 380px;
}

.mg-tooltip-last-updated .mg-tooltip-content {
	padding: 0.75rem;
}

.mg-tooltip-sources {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.mg-tooltip-source-row {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.75rem 1rem;
	background: var(--color-bg-card);
	border-radius: 8px;
	border: 1px solid var(--color-border-light);
}

.mg-tooltip-source-row:last-child {
	margin-bottom: 0;
}

.mg-source-dot {
	font-size: 1rem;
	line-height: 1;
	flex-shrink: 0;
}

.mg-source-name {
	font-size: 13px;
	font-weight: 500;
	color: var(--color-text-primary);
	flex-shrink: 0;
}

.mg-source-info {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.15rem;
	margin-left: auto;
}

.mg-source-time {
	font-size: 12px;
	color: #aaa;
}

.mg-source-next {
	font-size: 11px;
	color: var(--color-text-muted);
}

.mg-source-error {
	font-size: 11px;
	color: #ef4444;
	margin-top: 0.25rem;
}

.mg-tooltip-arrow[data-position="bottom"] {
	bottom: -12px;
	border-top-color: #2C2E34;
}

.mg-tooltip-arrow[data-position="top"] {
	top: -12px;
	border-bottom-color: #2C2E34;
}

/* Custom scrollbar for tooltip */
.mg-tooltip-content::-webkit-scrollbar {
	width: 6px;
}

.mg-tooltip-content::-webkit-scrollbar-track {
	background: var(--color-bg-secondary);
	border-radius: 3px;
}

.mg-tooltip-content::-webkit-scrollbar-thumb {
	background: #4a4a4a;
	border-radius: 3px;
}

.mg-tooltip-content::-webkit-scrollbar-thumb:hover {
	background: #5a5a5a;
}

.mg-tooltip-content {
	scrollbar-width: thin;
	scrollbar-color: #4a4a4a #1a1a1a;
}

/* Tooltip table layout (flexbox columns with header) */
.mg-tooltip-table {
	display: flex;
	flex-direction: column;
	gap: 0;
	min-width: 650px;
}

.mg-tooltip-table-header,
.mg-tooltip-table-row {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 6px 0;
}

.mg-tooltip-table-header {
	font-weight: 600;
	font-size: 0.75rem;
	color: var(--color-text-muted);
	text-transform: uppercase;
	border-bottom: 1px solid var(--color-border-light);
	margin-bottom: 2px;
	white-space: nowrap;
	position: sticky;
	top: 0;
	background: var(--color-bg-secondary);
	z-index: 1;
	padding-top: 8px;
	padding-bottom: 8px;
}

/* Verwachte horeca omzet + horeca omzet/inkoop + scan data: header styling aligned with other tooltips */
.mg-tooltip-verwachte-horeca .mg-tooltip-table-header,
.mg-tooltip-horeca-omzet .mg-tooltip-table-header,
.mg-tooltip-horeca-inkoop .mg-tooltip-table-header,
.mg-tooltip-totaal-gescand .mg-tooltip-table-header,
.mg-tooltip-no-show .mg-tooltip-table-header,
.mg-tooltip-gederiveerde-horeca .mg-tooltip-table-header,
.mg-tooltip-soldout .mg-tooltip-table-header,
.mg-tooltip-gem-besteding .mg-tooltip-table-header,
.mg-tooltip-tickets-gerealiseerd .mg-tooltip-table-header,
.mg-tooltip-bezoekers-live .mg-tooltip-table-header {
	font-weight: 600;
	font-size: 0.75em;
	color: var(--color-text-muted);
	text-transform: none;
	border-bottom: 1px solid rgba(255, 255, 255, 0.18);
	padding-bottom: 6px;
	padding-top: 0;
	margin-bottom: 2px;
	background: transparent;
}

.mg-tooltip-table-row {
	border-bottom: 1px solid var(--color-border);
}

.mg-tooltip-table-row:last-child {
	border-bottom: none;
}

/* Tooltip table column widths */
.mg-tooltip-col-status {
	width: 16px;
	text-align: center;
	flex-shrink: 0;
}

.mg-tooltip-col-date {
	flex: 0 0 70px;
	color: var(--color-text-muted);
	font-size: 0.75em;
	white-space: nowrap;
}

.mg-tooltip-col-event {
	flex: 1;
	min-width: 180px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mg-tooltip-col-number {
	width: 60px;
	text-align: right;
	flex-shrink: 0;
	white-space: nowrap;
}

.mg-tooltip-col-currency {
	width: 85px;
	text-align: right;
	flex-shrink: 0;
	white-space: nowrap;
}

.mg-tooltip-col-source {
	width: 60px;
	flex-shrink: 0;
	white-space: nowrap;
	font-size: 0.85em;
	color: var(--color-text-muted);
}

.mg-tooltip-col-badge {
	width: 70px;
	flex-shrink: 0;
	text-align: right;
}

/* Visitor Pressure Tooltip */
.mg-tooltip-pressure {
	min-width: 320px;
}

.mg-tooltip-pressure-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding-bottom: 8px;
	margin-bottom: 8px;
	border-bottom: 1px solid var(--color-border-light);
}

.mg-tooltip-pressure-total {
	font-weight: 700;
	font-size: 1.1em;
}

.mg-tooltip-pressure-pct {
	font-size: 0.9em;
	color: var(--color-text-muted);
}

.mg-tooltip-pressure-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 6px 0;
	border-bottom: 1px solid var(--color-border);
}

.mg-tooltip-pressure-row:last-child {
	border-bottom: none;
}

.mg-project-type-badge {
	display: inline-block;
	padding: 2px 6px;
	border-radius: 4px;
	font-size: 0.7em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	background: rgba(255, 255, 255, 0.12);
	color: rgba(255, 255, 255, 0.85);
	white-space: nowrap;
	flex-shrink: 0;
}

.mg-tooltip-pressure-name {
	flex: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mg-tooltip-pressure-visitors {
	font-weight: 600;
	min-width: 50px;
	text-align: right;
}

/* Source badges */
.mg-source-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 4px;
	font-size: 0.75em;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.mg-source-badge-verkocht {
	background: rgba(59, 130, 246, 0.15);
	color: #3b82f6;
}

.mg-source-badge-taxatie {
	background: rgba(168, 85, 247, 0.15);
	color: #a855f7;
}

.mg-source-badge-scan {
	background: rgba(22, 163, 74, 0.15);
	color: #16a34a;
}

.mg-source-badge-tags {
	background: rgba(59, 130, 246, 0.15);
	color: #3b82f6;
}

.mg-source-badge-gepland {
	background: rgba(107, 114, 128, 0.15);
	color: #6b7280;
}

.mg-dashboard-charts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
	gap: 2rem;
	margin-bottom: 2rem;
}

.mg-chart-container {
	position: relative;
	background: var(--color-bg-card);
	border: 1px solid var(--color-border-light);
	border-radius: 12px;
	padding: 1.5rem;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
	min-height: 350px;
	transition: transform 0.3s, box-shadow 0.3s;
}

.mg-chart-container:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
	border-color: var(--color-text-secondary);
}

.mg-chart-container h3 {
	margin: 0 0 1.5rem 0;
	font-size: 1.25rem;
	color: var(--color-text-primary);
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.mg-visitors-compare-indicator {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 0.875rem;
	font-weight: 600;
	margin-left: 0.5rem;
}

.mg-visitors-compare-indicator.mg-compare-up .mg-compare-arrow,
.mg-visitors-compare-indicator.mg-compare-up .mg-compare-pct {
	color: #22c55e;
}

.mg-visitors-compare-indicator.mg-compare-down .mg-compare-arrow,
.mg-visitors-compare-indicator.mg-compare-down .mg-compare-pct {
	color: #ef4444;
}

/* Visitors compare tooltip */
.mg-tooltip-compare {
	min-width: 240px;
	padding: 4px 0;
}

.mg-tooltip-compare-header {
	font-weight: 700;
	font-size: 0.95em;
	margin-bottom: 10px;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--color-border-light);
	color: var(--color-text-primary);
}

.mg-tooltip-compare-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 6px 0;
	gap: 16px;
}

.mg-tooltip-compare-label {
	font-size: 0.9em;
	color: var(--color-text-muted);
}

.mg-tooltip-compare-value {
	font-weight: 600;
	font-size: 1em;
	text-align: right;
}

.mg-tooltip-compare-value.mg-value-werkelijk.mg-value-up {
	color: #22c55e;
}

.mg-tooltip-compare-value.mg-value-werkelijk.mg-value-down {
	color: #ef4444;
}

.mg-tooltip-compare-footer {
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px solid var(--color-border-light);
	font-size: 0.9em;
	font-weight: 600;
}

.mg-tooltip-compare-pct.mg-compare-up {
	color: #22c55e;
}

.mg-tooltip-compare-pct.mg-compare-down {
	color: #ef4444;
}

.mg-chart-container canvas {
	max-height: 600px;
	width: 100% !important;
	height: 400px !important;
}

/* Chart row layout (for custom ACF-configured layouts) */
.mg-chart-row {
	display: flex;
	gap: 2rem;
	margin-bottom: 2rem;
}

.mg-chart-row .mg-chart-container {
	flex: 1 1 0;  /* Equal width for all charts in row */
	min-width: 0; /* Prevent overflow */
}

/* Custom Bar Chart Styles - Matching grafiek_style.png exactly */
.mg-bar-chart {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 1.5rem;
	padding: 0;
}

/* Remove empty paragraph tags from charts */
.mg-bar-chart p:empty,
.mg-bar-chart-row p:empty,
.bar-track p:empty {
	display: none !important;
	margin: 0 !important;
	padding: 0 !important;
	height: 0 !important;
	line-height: 0 !important;
}

.mg-bar-chart-row {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
}

.mg-bar-chart-label {
	font-size: 12px;
	font-weight: 500;
	color: var(--color-text-secondary);
	min-width: 100px;
	font-family: 'Inter', sans-serif;
	letter-spacing: 0.3px;
	flex-shrink: 0;
}

/* Keep uppercase only for Project Types chart */
#chart-project-types .mg-bar-chart-label {
	text-transform: uppercase;
}

.bar-track {
	flex: 1;
	height: 28px;
	background: var(--bg-secondary, #1a1a1a);
	border-radius: 8px;
	overflow: hidden;
	position: relative;
	min-width: 0;
}

.bar-track .bar-fill {
	height: 100%;
	border-radius: 8px;
	display: flex;
	align-items: center;
	padding-left: 10px;
	color: var(--color-text-primary);
	font-weight: 600;
	font-size: 13px;
	transition: width 0.5s ease;
	position: relative;
	min-width: fit-content;
	font-family: 'Inter', sans-serif;
}

.bar-track .bar-fill .bar-value {
	white-space: nowrap;
	z-index: 1;
	line-height: 1;
}

.mg-dashboard-table {
	background: var(--color-bg-secondary);
	border: 1px solid var(--color-border);
	border-radius: 12px;
	padding: 1.5rem;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
	margin-bottom: 2rem;
	width: 100%;
	box-sizing: border-box;
}

.mg-table-wrapper {
	overflow-x: auto;
	overflow-y: visible;
	-webkit-overflow-scrolling: touch;
	width: 100%;
	position: relative;
}

/* Budget overzicht: keep horizontal scroll, avoid internal vertical scroll */
.mg-dashboard-table .mg-table-wrapper {
	overflow-x: auto;
	overflow-y: visible;
}

/* Custom scrollbar for Budget Overzicht table */
.mg-dashboard-table .mg-table-wrapper {
	scrollbar-width: thin; /* Firefox */
	scrollbar-color: #4a4a4a #111; /* thumb | track */
}

.mg-dashboard-table .mg-table-wrapper::-webkit-scrollbar {
	height: 10px; /* horizontal scrollbar */
	width: 10px;  /* (in case vertical shows up) */
}

.mg-dashboard-table .mg-table-wrapper::-webkit-scrollbar-track {
	background: #111;
	border-radius: 999px;
}

.mg-dashboard-table .mg-table-wrapper::-webkit-scrollbar-thumb {
	background: var(--color-border-light);
	border-radius: 999px;
	border: 2px solid #111; /* creates padding inside track */
}

.mg-dashboard-table .mg-table-wrapper::-webkit-scrollbar-thumb:hover {
	background: #4a9eff;
}

.mg-dashboard-table .mg-table-wrapper::-webkit-scrollbar-corner {
	background: transparent;
}

/* Scroll hint: inset shadow on the scroll container itself (never scrolls with content) */
.mg-dashboard-table .mg-table-wrapper.mg-scroll-hint-right {
	/* Keep it subtle: hint without obscuring values */
	box-shadow: inset -26px 0 22px -18px rgba(255, 255, 255, 0.26),
		inset -40px 0 36px -24px rgba(0, 0, 0, 0.70);
}

.mg-table-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 1rem;
	flex-wrap: wrap;
	gap: 1rem;
}

.mg-dashboard-table h2 {
	margin: 0;
	color: var(--color-text-primary);
	font-weight: 600;
	font-size: 1.5rem;
}

.mg-budget-save-info {
	display: flex;
	align-items: center;
	gap: 1rem;
	flex-wrap: wrap;
}

.mg-save-status {
	font-size: 0.875rem;
	color: #4ade80;
	font-family: 'Inter', sans-serif;
	font-weight: 500;
}

.mg-no-budget-warning {
	font-size: 0.875rem;
	color: #ffa500;
	font-family: 'Inter', sans-serif;
	font-weight: 500;
}

.mg-btn-save-all {
	background: #4a9eff;
	border-color: var(--color-accent-blue);
	padding: 0.5rem 1rem;
	font-size: 0.875rem;
}

.mg-btn-save-all:hover {
	background: #3a8eef;
	border-color: #3a8eef;
}

.mg-dashboard-table table {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
}

/* Budget overzicht table should be allowed to exceed container width (scroll) */
#mg-budget-table {
	width: max-content;
	min-width: 100%;
	table-layout: auto;
	border-collapse: separate;
	border-spacing: 0;
}

.mg-dashboard-table th,
.mg-dashboard-table td {
	padding: 0.875rem 0.75rem;
	text-align: left;
	border-bottom: 1px solid var(--color-border);
	color: var(--color-text-primary);
	overflow: visible;
	text-overflow: ellipsis;
	position: relative;
}

.mg-dashboard-table th {
	background: #151515;
	font-weight: 600;
	color: var(--color-text-primary);
	text-transform: uppercase;
	font-size: 0.7rem;
	letter-spacing: 0.5px;
	position: sticky;
	top: 0;
	z-index: 10;
}

/* Sticky thead clone: JS creates a position:fixed clone when the header scrolls past */
.mg-sticky-thead-clone {
	position: fixed;
	top: 70px;
	overflow: hidden;
	z-index: 100;
	pointer-events: auto;
	box-shadow: 0 3px 12px rgba(0, 0, 0, 0.45);
}

.mg-sticky-thead-clone table {
	will-change: transform;
}

body.mg-dashboard-page.theme-light .mg-sticky-thead-clone {
	box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
}

.mg-dashboard-table .col-project-type {
	width: 15%;
	min-width: 120px;
	white-space: normal;
	word-wrap: break-word;
	font-size: 0.875rem;
}

/* Sticky first column for Budget Overzicht */
#mg-budget-table th.col-project-type,
#mg-budget-table td.col-project-type {
	position: sticky;
	left: 0;
	background: var(--color-bg-secondary);
	z-index: 20;
	box-shadow: 6px 0 10px rgba(0, 0, 0, 0.35);
}

#mg-budget-table thead th.col-project-type {
	background: #151515;
	z-index: 40; /* above other sticky headers – both sticky left + sticky top */
}

.mg-dashboard-table .col-number {
	text-align: right;
	width: 10%;
	min-width: 90px;
	font-variant-numeric: tabular-nums;
	font-size: 0.9rem;
}

.mg-dashboard-table .col-currency {
	text-align: right;
	width: 12%;
	min-width: 130px;
	font-variant-numeric: tabular-nums;
	font-size: 0.9rem;
}

.mg-dashboard-table tfoot {
	border-top: 2px solid var(--color-border-light);
}

.mg-dashboard-table tfoot tr.mg-table-total {
	background: #151515;
}

.mg-dashboard-table tfoot td {
	padding: 1rem 0.75rem;
	font-weight: 700;
	color: var(--color-text-primary);
	border-top: 2px solid var(--color-border-light);
}

/* Sticky total row for Budget Overzicht */
#mg-budget-table tfoot td {
	position: sticky;
	bottom: 0;
	background: #151515;
	z-index: 30;
}

/* Intersection: sticky left + sticky bottom */
#mg-budget-table tfoot td.col-project-type {
	z-index: 45;
}

.mg-dashboard-table input[type="number"] {
	width: 100%;
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--color-border-light);
	border-radius: 6px;
	background: #0f0f0f;
	color: var(--color-text-primary);
	text-align: right;
	font-variant-numeric: tabular-nums;
	font-size: 0.9rem;
	box-sizing: border-box;
	pointer-events: auto !important;
	cursor: text !important;
	position: relative;
	z-index: 1;
	/* Remove spinner arrows */
	-moz-appearance: textfield;
}

.mg-dashboard-table input[type="number"]::-webkit-outer-spin-button,
.mg-dashboard-table input[type="number"]::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.mg-budget-input {
	color: #ff9e79 !important;
}

.mg-horeca-input {
	color: #ff9e79 !important;
	pointer-events: auto !important;
	cursor: text !important;
	position: relative;
	z-index: 1;
}

.mg-dashboard-table input[type="number"]:focus {
	outline: none;
	border-color: var(--color-accent-blue);
	background: var(--color-bg-secondary);
}

.mg-dashboard-table .positive {
	color: #4ade80;
	font-weight: 600;
}

.mg-dashboard-table .negative {
	color: #f87171;
	font-weight: 600;
}

.mg-dashboard-actions {
	display: flex;
	gap: 1rem;
	align-items: center;
	flex-wrap: wrap;
}

.mg-btn {
	padding: 0.625rem 1.25rem;
	border: 1px solid var(--color-border-light);
	border-radius: 8px;
	background: var(--color-bg-secondary);
	color: var(--color-text-primary);
	cursor: pointer;
	font-size: 0.875rem;
	font-weight: 500;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1.4;
	height: auto;
}

.mg-btn:hover {
	background: var(--color-bg-card);
	border-color: var(--color-text-secondary);
}

.mg-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.mg-btn-secondary {
	background: rgba(102, 102, 102, 0.8);
	backdrop-filter: blur(10px);
}

.mg-btn-secondary:hover {
	background: rgba(85, 85, 85, 0.9);
}

.mg-budget-active-badge {
	display: inline-block;
	padding: 0.25rem 0.75rem;
	background: #34A853;
	color: var(--color-text-primary);
	border-radius: 12px;
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.mg-budget-item-meta {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin-bottom: 1rem;
}

.mg-budget-date {
	font-size: 0.875rem;
	color: #9CA3AF;
	font-family: 'Inter', sans-serif;
}

.mg-budget-item-actions {
	display: flex;
	gap: 0.75rem;
	align-items: center;
}

.mg-btn-danger {
	background: #DB4437;
	border-color: #DB4437;
	color: var(--color-text-primary);
}

.mg-btn-danger:hover {
	background: #E74C3C;
	border-color: #E74C3C;
}

.mg-btn-disabled {
	opacity: 0.6;
	cursor: not-allowed;
	background: #34A853;
	border-color: #34A853;
}

.mg-btn-edit {
	background: #4a9eff;
	border-color: var(--color-accent-blue);
}

.mg-btn-edit:hover {
	background: #3a8eef;
	border-color: #3a8eef;
}

.mg-btn-save {
	background: #34A853;
	border-color: #34A853;
}

.mg-btn-save:hover {
	background: #2d9549;
	border-color: #2d9549;
}


.mg-budget-list {
	margin-top: 3rem;
	padding-top: 2rem;
	border-top: 1px solid var(--color-border-light);
}

.mg-budget-list h2 {
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--color-text-primary);
	margin-bottom: 1.5rem;
	font-family: 'Inter', sans-serif;
}

.mg-budget-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	background: var(--color-bg-secondary);
	border-radius: 12px;
	overflow: hidden;
	font-size: 13px;
	display: flex;
	flex-direction: column;
}

.mg-budget-table thead {
	background: #23262B;
	display: flex;
	flex-direction: column;
}

.mg-budget-table .col-horeca-header,
.mg-budget-table .col-bezoekers-header,
#mg-budget-table .col-horeca-header,
#mg-budget-table .col-bezoekers-header {
	text-align: center !important;
	font-weight: 600;
	vertical-align: middle;
}

/* Bezoekers header styling - matching the column group */
#mg-budget-table th.col-bezoekers-header {
	text-align: center !important;
	background: linear-gradient(rgba(66, 133, 244, 0.25), rgba(66, 133, 244, 0.25)), #151515 !important;
	border: none !important;
}

/* Horeca header styling - matching the column group */
#mg-budget-table th.col-horeca-header {
	text-align: center !important;
	background: linear-gradient(rgba(244, 180, 0, 0.25), rgba(244, 180, 0, 0.25)), #151515 !important;
	border: none !important;
}

/* Visual grouping for Bezoekers columns */
#mg-budget-table td.col-bezoekers-group,
#mg-budget-table th.col-bezoekers-group {
	background-color: rgba(66, 133, 244, 0.15) !important;
	position: relative;
}

#mg-budget-table td.col-bezoekers-group:first-of-type,
#mg-budget-table th.col-bezoekers-group:first-of-type {
	border-left: 4px solid rgba(66, 133, 244, 0.8) !important;
}

#mg-budget-table td.col-bezoekers-group:last-of-type,
#mg-budget-table th.col-bezoekers-group:last-of-type {
	border-right: 4px solid rgba(66, 133, 244, 0.8) !important;
}

#mg-budget-table thead th.col-bezoekers-group {
	background: linear-gradient(rgba(66, 133, 244, 0.25), rgba(66, 133, 244, 0.25)), #151515 !important;
}

#mg-budget-table tbody tr:first-child td.col-bezoekers-group {
	border-top: 2px solid rgba(66, 133, 244, 0.6) !important;
}

#mg-budget-table tbody tr:last-child td.col-bezoekers-group {
	border-bottom: 2px solid rgba(66, 133, 244, 0.6) !important;
}

#mg-budget-table tfoot td.col-bezoekers-group {
	background-color: rgba(66, 133, 244, 0.2) !important;
	border: none !important;
}

/* Visual grouping for Horeca columns */
#mg-budget-table td.col-horeca-group,
#mg-budget-table th.col-horeca-group {
	background-color: rgba(244, 180, 0, 0.15) !important;
	position: relative;
}

#mg-budget-table td.col-horeca-group:first-of-type,
#mg-budget-table th.col-horeca-group:first-of-type {
	border-left: 4px solid rgba(244, 180, 0, 0.8) !important;
}

#mg-budget-table td.col-horeca-group:last-of-type,
#mg-budget-table th.col-horeca-group:last-of-type {
	border-right: none !important;
}

#mg-budget-table thead th.col-horeca-group {
	background: linear-gradient(rgba(244, 180, 0, 0.25), rgba(244, 180, 0, 0.25)), #151515 !important;
}

#mg-budget-table tbody tr:first-child td.col-horeca-group {
	border-top: 2px solid rgba(244, 180, 0, 0.6) !important;
}

#mg-budget-table tbody tr:last-child td.col-horeca-group {
	border-bottom: 2px solid rgba(244, 180, 0, 0.6) !important;
}

#mg-budget-table tfoot td.col-horeca-group {
	background-color: rgba(244, 180, 0, 0.2) !important;
	border: none !important;
}

.mg-budget-table th {
	padding: 1rem;
	text-align: left;
	font-weight: 600;
	color: var(--color-text-primary);
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	border-bottom: 2px solid var(--color-border-light);
	font-family: 'Inter', sans-serif;
	flex: 1;
}

.mg-budget-table thead tr:first-child th {
	text-align: center;
}

.mg-budget-table tbody {
	display: flex;
	flex-direction: column;
}

.mg-budget-table tbody tr {
	display: flex;
}

.mg-budget-table thead tr {
	display: flex;
}

.mg-budget-table td,
.mg-budget-table th {
	flex: 1;
}

.mg-budget-table td {
	padding: 1rem;
	border-bottom: 1px solid var(--color-border);
	color: var(--color-text-primary);
	font-family: 'Inter', sans-serif;
	font-size: 13px;
}

/* Override border-collapse for grouped columns */
#mg-budget-table {
	border-collapse: separate !important;
	border-spacing: 0 !important;
}

.mg-budget-table tbody tr.mg-budget-item {
	background: var(--color-bg-secondary);
	transition: background 0.2s ease;
}

.mg-budget-table tbody tr.mg-budget-item:hover {
	background: #23262B;
}

.mg-budget-table tbody tr.mg-budget-item:last-child td {
	border-bottom: none;
}

.mg-budget-input:disabled,
.mg-budget-input[readonly] {
	cursor: not-allowed !important;
	opacity: 0.6;
	background: #2a2a2a !important;
}

.mg-readonly-warning {
	font-size: 11px;
	color: var(--color-text-muted);
	font-style: italic;
}

.mg-budget-readonly-badge {
	font-size: 10px;
	color: var(--color-text-muted);
	font-style: italic;
}

.mg-budget-title-edit {
	width: 100%;
	padding: 0.5rem;
	border: 1px solid #4a9eff;
	border-radius: 6px;
	background: var(--color-bg-secondary);
	color: var(--color-text-primary);
	font-size: 13px;
	font-weight: 500;
	font-family: 'Inter', sans-serif;
	box-sizing: border-box;
}

.mg-budget-title-edit:focus {
	outline: none;
	border-color: var(--color-accent-blue);
	background: var(--color-bg-card-alt);
}

.mg-budget-active-badge {
	background: #34A853;
	color: var(--color-text-primary);
	padding: 0.25rem 0.75rem;
	border-radius: 12px;
	font-size: 13px;
	font-weight: 600;
	font-family: 'Inter', sans-serif;
}

.mg-budget-inactive {
	color: #9CA3AF;
	font-size: 13px;
	font-family: 'Inter', sans-serif;
}

.mg-budget-year-display {
	color: var(--color-text-primary);
	font-weight: 500;
}

.mg-budget-year-edit {
	width: 100%;
	padding: 0.5rem;
	border: 1px solid #4a9eff;
	border-radius: 6px;
	background: var(--color-bg-secondary);
	color: var(--color-text-primary);
	font-size: 13px;
	font-weight: 500;
	font-family: 'Inter', sans-serif;
	cursor: pointer;
	box-sizing: border-box;
}

.mg-budget-year-edit:focus {
	outline: none;
	border-color: var(--color-accent-blue);
	background: var(--color-bg-card-alt);
}

.mg-budget-date {
	color: #9CA3AF;
}

.mg-budget-item-actions {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
	align-items: center;
}

.mg-budget-item-actions .mg-btn {
	font-size: 13px;
	padding: 0.5rem 0.75rem;
	white-space: nowrap;
}

.mg-loading {
	text-align: center;
	padding: 2rem;
	color: var(--color-text-dimmed);
}

.mg-error {
	background: #fee;
	border: 1px solid #fcc;
	border-radius: 4px;
	padding: 1rem;
	color: #c33;
	margin-bottom: 1rem;
}

.mg-error pre {
	background: #f5f5f5;
	padding: 1rem;
	overflow: auto;
	font-size: 0.8em;
	margin-top: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
	.mg-dashboard-wrapper {
		padding: 1rem;
	}
	
	.mg-dashboard-header {
		flex-direction: column;
		align-items: flex-start;
	}
	
	.mg-dashboard-stats {
		flex-direction: column;
	}
	
	.mg-stat-tile {
		min-width: 100%;
	}

	.mg-stat-group {
		flex: 1 1 auto;
	}

	.mg-stat-group-tiles {
		flex-direction: column;
	}
	
	.mg-dashboard-charts {
		grid-template-columns: 1fr;
	}
	
	.mg-chart-row {
		flex-direction: column;
	}
	
	.mg-dashboard-table {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}
	
	.mg-filter-buttons {
		width: 100%;
	}
}

/* Prevent horizontal overflow */
* {
	box-sizing: border-box;
}

body.mg-dashboard-page {
	overflow-x: hidden;
}

.mg-dashboard-wrapper,
.mg-dashboard-header,
.mg-dashboard-stats,
.mg-dashboard-charts,
.mg-chart-row,
.mg-dashboard-table {
	max-width: 100%;
}

/* Genre Spending Table */
.mg-genre-spending-section {
	margin-top: 2rem;
}

#mg-genre-spending-table {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
}

#mg-genre-spending-table th,
#mg-genre-spending-table td {
	padding: 0.75rem 1rem;
	border-bottom: 1px solid #333;
}

#mg-genre-spending-table th {
	text-align: left;
	font-weight: 600;
	background: var(--color-bg-secondary);
	color: var(--color-text-primary);
	text-transform: uppercase;
	font-size: 0.75rem;
	letter-spacing: 0.05em;
}

#mg-genre-spending-table td {
	text-align: left;
}

/* Column widths */
#mg-genre-spending-table .col-genre {
	width: 40%;
}

#mg-genre-spending-table .col-number {
	width: 15%;
	text-align: right;
}

#mg-genre-spending-table .col-percentage {
	width: 15%;
	text-align: right;
}

#mg-genre-spending-table .col-currency {
	width: 30%;
	text-align: right;
}

#mg-genre-spending-table td.col-number,
#mg-genre-spending-table th.col-number {
	text-align: right;
}

#mg-genre-spending-table td.col-percentage,
#mg-genre-spending-table th.col-percentage {
	text-align: right;
}

#mg-genre-spending-table td.col-currency,
#mg-genre-spending-table th.col-currency {
	text-align: right;
}

#mg-genre-spending-table tbody tr:hover {
	background: rgba(255, 255, 255, 0.05);
}

#mg-genre-spending-table tfoot {
	background: var(--color-bg-secondary);
}

#mg-genre-spending-table tfoot td {
	border-top: 2px solid #444;
	font-weight: 600;
}

/* Sortable column header */
#mg-genre-spending-table th.col-sortable {
	cursor: pointer;
	user-select: none;
	transition: background-color 0.2s ease;
}

#mg-genre-spending-table th.col-sortable:hover {
	background: var(--color-bg-card);
}

#mg-genre-spending-table th.col-sortable .sort-icon {
	margin-left: 6px;
	font-size: 0.85em;
	opacity: 0.6;
	transition: opacity 0.2s ease;
}

#mg-genre-spending-table th.col-sortable:hover .sort-icon {
	opacity: 1;
}

#mg-genre-spending-table th.col-sortable[data-sort="desc"] .sort-icon,
#mg-genre-spending-table th.col-sortable[data-sort="asc"] .sort-icon {
	opacity: 1;
	color: var(--color-accent-blue);
}

/* Genre hierarchy styling - subtle parent rows */
#mg-genre-spending-table .mg-genre-row-parent,
#mg-genre-spending-table .mg-genre-row-aggregate {
	background: rgba(255, 255, 255, 0.02);
}

#mg-genre-spending-table .mg-genre-row-parent td,
#mg-genre-spending-table .mg-genre-row-aggregate td {
	border-bottom: 1px solid rgba(255, 255, 255, 0.15);
	padding-top: 0.875rem;
	padding-bottom: 0.625rem;
}

#mg-genre-spending-table .mg-genre-row-parent .col-genre strong,
#mg-genre-spending-table .mg-genre-row-aggregate .col-genre strong {
	color: var(--color-text-primary);
	font-weight: 600;
}

#mg-genre-spending-table .mg-genre-group-icon {
	margin-right: 6px;
	font-size: 0.6em;
	opacity: 0.4;
	color: var(--color-text-muted);
}

#mg-genre-spending-table .mg-genre-group-count {
	margin-left: 6px;
	font-size: 0.75em;
	font-weight: normal;
	opacity: 0.4;
	color: var(--color-text-muted);
}

#mg-genre-spending-table .mg-genre-row-child {
	background: transparent;
}

#mg-genre-spending-table .mg-genre-row-child td {
	padding-left: 0.5rem;
	font-size: 0.95em;
	color: #ccc;
}

#mg-genre-spending-table .mg-genre-indent {
	padding-left: 2rem !important;
	position: relative;
}

#mg-genre-spending-table .mg-genre-indent::before {
	content: '└';
	position: absolute;
	left: 0.75rem;
	color: var(--color-text-dimmed);
	font-size: 0.8rem;
	opacity: 0.5;
}

/* ============================================
   Year-over-Year (YoY) Comparison Indicator
   ============================================ */
.mg-yoy-change {
	font-size: 0.65rem;
	font-weight: 600;
	margin-left: 6px;
	padding: 2px 6px;
	border-radius: 4px;
	vertical-align: middle;
	display: inline-block;
	line-height: 1.2;
	white-space: nowrap;
}

.mg-yoy-change.positive {
	color: #16a34a;
	background: rgba(22, 163, 74, 0.15);
}

.mg-yoy-change.negative {
	color: #dc2626;
	background: rgba(220, 38, 38, 0.15);
}

.mg-yoy-change.neutral {
	color: var(--color-text-muted);
	background: var(--color-overlay-light);
}

.mg-yoy-change.hidden {
	display: none;
}

/* Light theme adjustments for YoY */
body.mg-dashboard-page.theme-light .mg-yoy-change.positive {
	color: #15803d;
	background: rgba(22, 163, 74, 0.12);
}

body.mg-dashboard-page.theme-light .mg-yoy-change.negative {
	color: #b91c1c;
	background: rgba(220, 38, 38, 0.12);
}

body.mg-dashboard-page.theme-light .mg-yoy-change.neutral {
	color: var(--color-text-secondary);
	background: rgba(0, 0, 0, 0.06);
}

/* ============================================
   Permission Manager Styles
   ============================================ */

/* Visitor Pressure Badge */
.mg-visitor-pressure-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	/* background is set dynamically via inline style based on capacity percentage */
	color: white;
	border-radius: 6px;
	font-size: 11px;
	font-weight: 600;
	margin-right: 12px;
	box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
	transition: all 0.2s ease;
	cursor: default;
	white-space: nowrap;
}

.mg-visitor-pressure-badge:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.mg-visitor-pressure-badge svg {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}

.mg-visitor-pressure-badge .mg-pressure-count {
	font-weight: 700;
	font-size: 13px;
}

.mg-visitor-pressure-badge .mg-pressure-label {
	font-weight: 500;
	opacity: 0.9;
}

/* Supervisor Badge */
.mg-supervisor-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
	color: white;
	border-radius: 6px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.8px;
	margin-right: 16px;
	box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
	transition: all 0.2s ease;
}

/* Clickable supervisor badge (for permission management) */
.mg-supervisor-badge-clickable {
	cursor: pointer;
	user-select: none;
}

.mg-supervisor-badge:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.mg-supervisor-badge-clickable:hover {
	background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
}

.mg-supervisor-badge svg {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}

.mg-btn-permissions:hover {
	background: var(--color-bg-hover);
	border-color: var(--color-primary);
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.mg-btn-permissions:active {
	transform: translateY(0);
}

.mg-btn-permissions svg {
	flex-shrink: 0;
}

/* Modal Overlay */
.mg-modal {
	position: fixed;
	z-index: 10000;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.75);
	backdrop-filter: blur(4px);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

/* Modal Content */
.mg-modal-content {
	background: var(--color-bg-card);
	border: 1px solid var(--color-border-light);
	border-radius: 12px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
	width: 100%;
	max-width: 800px;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
}

/* Modal Header */
.mg-modal-header {
	padding: 24px 28px;
	border-bottom: 1px solid var(--color-border);
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-shrink: 0;
}

.mg-modal-header h2 {
	margin: 0;
	font-size: 20px;
	font-weight: 700;
	color: var(--color-text-primary);
	font-family: 'Inter', sans-serif;
}

.mg-modal-close {
	background: none;
	border: none;
	color: var(--color-text-secondary);
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 6px;
	transition: all 0.2s ease;
}

.mg-modal-close:hover {
	background: var(--color-bg-hover);
	color: var(--color-text-primary);
}

/* Modal Body */
.mg-modal-body {
	padding: 28px;
	overflow-y: auto;
	flex: 1;
}

/* User Selector */
.mg-permission-user-selector {
	margin-bottom: 28px;
}

.mg-permission-user-selector label {
	display: block;
	margin-bottom: 8px;
	font-weight: 600;
	font-size: 14px;
	color: var(--color-text-primary);
}

.mg-permission-user-selector .mg-select {
	width: 100%;
	padding: 12px 16px;
	background: var(--color-bg-input);
	border: 1px solid var(--color-border);
	border-radius: 8px;
	color: var(--color-text-primary);
	font-size: 14px;
	font-family: 'Inter', sans-serif;
	cursor: pointer;
	transition: all 0.2s ease;
}

.mg-permission-user-selector .mg-select:hover {
	border-color: var(--color-border-light);
}

.mg-permission-user-selector .mg-select:focus {
	outline: none;
	border-color: var(--color-primary);
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Permission Section */
.mg-permission-section {
	margin-bottom: 28px;
	padding: 20px;
	background: var(--color-bg-secondary);
	border: 1px solid var(--color-border);
	border-radius: 10px;
}

.mg-permission-section-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 16px;
}

.mg-permission-section h3 {
	margin: 0 0 16px 0;
	font-size: 16px;
	font-weight: 700;
	color: var(--color-text-primary);
}

.mg-permission-actions {
	font-size: 13px;
}

.mg-permission-actions a {
	color: var(--color-primary);
	text-decoration: none;
	font-weight: 600;
	transition: color 0.2s ease;
}

.mg-permission-actions a:hover {
	color: var(--color-primary-hover);
	text-decoration: underline;
}

/* Checkbox Group */
.mg-checkbox-group {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 12px;
}

.mg-checkbox-label {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	background: var(--color-bg-card);
	border: 1px solid var(--color-border);
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.2s ease;
	user-select: none;
}

.mg-checkbox-label:hover {
	background: var(--color-bg-hover);
	border-color: var(--color-border-light);
}

.mg-checkbox-label input[type="checkbox"] {
	width: 18px;
	height: 18px;
	cursor: pointer;
	flex-shrink: 0;
}

.mg-checkbox-label span {
	font-size: 14px;
	color: var(--color-text-primary);
	line-height: 1.4;
}

.mg-checkbox-label input[type="checkbox"]:checked + span {
	font-weight: 600;
}

/* Share Link Section */
.mg-share-link-section {
	padding: 16px 28px;
	border-top: 1px solid var(--color-border);
	background: rgba(99, 102, 241, 0.05);
}

.mg-share-link-section label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--color-text-secondary);
	margin-bottom: 8px;
}

.mg-share-link-row {
	display: flex;
	gap: 8px;
	align-items: stretch;
}

.mg-share-url-input {
	flex: 1;
	padding: 10px 14px;
	font-size: 13px;
	font-family: 'Fira Code', 'Monaco', monospace;
	background: var(--color-bg-tertiary);
	border: 1px solid var(--color-border);
	border-radius: 6px;
	color: var(--color-text-primary);
	min-width: 0;
}

.mg-share-url-input:focus {
	outline: none;
	border-color: var(--color-primary);
	box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.mg-btn-copy {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 10px 14px;
	background: var(--color-primary);
	color: white;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.2s ease;
	flex-shrink: 0;
}

.mg-btn-copy:hover {
	background: var(--color-primary-hover);
	transform: translateY(-1px);
}

.mg-btn-copy.mg-copied {
	background: var(--color-success);
}

.mg-share-link-hint {
	display: block;
	margin-top: 8px;
	font-size: 12px;
	color: var(--color-text-muted);
}

/* Modal Footer */
.mg-modal-footer {
	padding: 20px 28px;
	border-top: 1px solid var(--color-border);
	display: flex;
	gap: 12px;
	justify-content: flex-end;
	flex-shrink: 0;
}

.mg-btn-primary,
.mg-btn-secondary {
	padding: 12px 24px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	font-family: 'Inter', sans-serif;
	cursor: pointer;
	transition: all 0.2s ease;
	border: none;
}

.mg-btn-primary {
	background: var(--color-primary);
	color: white;
}

.mg-btn-primary:hover:not(:disabled) {
	background: var(--color-primary-hover);
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.mg-btn-primary:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.mg-btn-primary.mg-btn-success {
	background: var(--color-success);
}

.mg-btn-secondary {
	background: var(--color-bg-secondary);
	color: var(--color-text-primary);
	border: 1px solid var(--color-border);
}

.mg-btn-secondary:hover {
	background: var(--color-bg-hover);
	border-color: var(--color-border-light);
}

/* Light Theme Overrides */
body.mg-dashboard-page.theme-light .mg-modal-content {
	background: #ffffff;
	border-color: #e5e7eb;
}

body.mg-dashboard-page.theme-light .mg-permission-section {
	background: #f9fafb;
	border-color: #e5e7eb;
}

body.mg-dashboard-page.theme-light .mg-checkbox-label {
	background: #ffffff;
	border-color: #e5e7eb;
}

body.mg-dashboard-page.theme-light .mg-checkbox-label:hover {
	background: #f9fafb;
}

body.mg-dashboard-page.theme-light .mg-btn-permissions {
	background: #f9fafb;
	border-color: #d1d5db;
}

body.mg-dashboard-page.theme-light .mg-btn-permissions:hover {
	background: #f3f4f6;
}

body.mg-dashboard-page.theme-light .mg-share-link-section {
	background: rgba(99, 102, 241, 0.08);
}

body.mg-dashboard-page.theme-light .mg-share-url-input {
	background: #ffffff;
	border-color: #d1d5db;
	color: #111827;
}
