/*
 * ALC LMS Core App Layouts - macOS Human Interface Aesthetics
 */

/* SPA Core Shell Layout */
.app-shell {
	display: flex;
	flex-direction: row;
	min-height: 100vh;
	width: 100%;
}

/* Translucent macOS Style Sidebar */
.app-sidebar {
	width: 270px;
	background-color: rgba(255, 255, 255, 0.75);
	backdrop-filter: blur(25px);
	-webkit-backdrop-filter: blur(25px);
	border-right: 1px solid rgba(0, 0, 0, 0.08);
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	height: 100vh;
	position: sticky;
	top: 0;
	z-index: 100;
	padding: 32px 20px;
	flex-shrink: 0;
}

/* Brand Section inside Sidebar */
.brand-section {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 14px;
	margin-bottom: 32px;
	padding-left: 8px;
}

/* macOS Window Traffic-Light Circles */
.brand-circles {
	display: flex;
	gap: 7px;
}
.brand-circle {
	width: 12px;
	height: 12px;
	border-radius: var(--radius-round);
	box-shadow: inset 0 1px 1px rgba(0,0,0,0.15);
}
.brand-circle.red { background-color: #ff5f56; border: 1px solid #e0443e; }
.brand-circle.orange { background-color: #ffbd2e; border: 1px solid #dea123; }
.brand-circle.green { background-color: #27c93f; border: 1px solid #1aab29; }
.brand-circle.blue { background-color: #0071e3; border: 1px solid #005bb5; }

.brand-title {
	font-size: 17px;
	font-weight: 800;
	letter-spacing: -0.03em;
	color: var(--color-text-primary);
}

/* Vertical Navigation Tabs inside Sidebar */
.nav-tabs {
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex-grow: 1;
	width: 100%;
}

.nav-tab {
	display: flex;
	align-items: center;
	font-family: var(--font-body);
	font-weight: 500;
	font-size: 13px;
	color: var(--color-text-secondary);
	text-decoration: none;
	padding: 9px 14px;
	width: 100%;
	height: 38px;
	border-radius: var(--radius-sm);
	border: none;
	background: transparent;
	cursor: pointer;
	transition: all var(--transition-fast);
	user-select: none;
}
.nav-tab:hover {
	color: var(--color-text-primary);
	background-color: rgba(0, 0, 0, 0.04);
}
.nav-tab.active {
	color: #ffffff;
	background-color: var(--color-brand-blue);
	font-weight: 600;
	box-shadow: 0 3px 10px rgba(0, 113, 227, 0.3);
}

/* User Profile Badge inside Sidebar */
.user-profile-badge {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
	border-top: 1px solid rgba(0, 0, 0, 0.06);
	padding-top: 20px;
	width: 100%;
}
.user-info {
	text-align: left;
	padding-left: 4px;
}
.user-info .name {
	font-weight: 700;
	font-size: 13px;
	color: var(--color-text-primary);
	letter-spacing: -0.01em;
}
.user-info .role {
	font-size: 11px;
	font-weight: 600;
	color: var(--color-text-muted);
	margin-top: 2px;
}

/* Main Viewport Container */
#main-view-viewport {
	flex: 1;
	padding: 32px 40px;
	overflow-y: auto;
	height: 100vh;
	background-color: var(--color-bg);
}

.btn-logout {
	width: 100%;
	height: 36px;
	font-size: 12px;
	font-weight: 600;
	border-radius: var(--radius-sm);
	background: rgba(255, 59, 48, 0.08);
	border: 1px solid rgba(255, 59, 48, 0.15);
	color: var(--color-attention-dark);
	cursor: pointer;
	transition: all var(--transition-fast);
}
.btn-logout:hover {
	background: #ff3b30;
	border-color: #ff3b30;
	color: #ffffff;
}

/* Main Dashboard Wrapper */
.dashboard-container {
	max-width: 1400px;
	width: 100%;
	margin: 0 auto;
	padding: 32px;
	display: flex;
	flex-direction: column;
	gap: 32px;
}

.dashboard-title-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.class-picker {
	padding: 8px 16px;
	border-radius: var(--radius-round);
	border: 1px solid var(--color-border);
	background: #ffffff;
	font-family: var(--font-headers);
	font-weight: 600;
	font-size: 14px;
	color: var(--color-text-secondary);
	outline: none;
	cursor: pointer;
}

/* Main Cards Grid */
.dashboard-grid-top {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 24px;
}

/* Double column layouts */
.dashboard-split-grid {
	display: grid;
	grid-template-columns: 2fr 1fr;
	gap: 24px;
}
@media (max-width: 1024px) {
	.dashboard-split-grid {
		grid-template-columns: 1fr;
	}
}

/* Quick Tools List */
.tools-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 16px;
}
.tool-card {
	background: #ffffff;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
	padding: 24px 16px;
	text-align: center;
	cursor: pointer;
	transition: all var(--transition-normal);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}
.tool-card:hover {
	border-color: var(--color-brand-blue);
	box-shadow: var(--shadow-md);
	transform: translateY(-2px);
}
.tool-card .icon-holder {
	width: 44px;
	height: 44px;
	border-radius: var(--radius-round);
	background: var(--color-brand-blue-light);
	color: var(--color-brand-blue);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
}
.tool-card p {
	font-family: var(--font-headers);
	font-weight: 600;
	font-size: 14px;
	color: var(--color-text-primary);
}

/* Timetable schedule cards */
.schedule-list {
	display: flex;
	flex-direction: column;
	gap: 16px;
	max-height: 450px;
	overflow-y: auto;
	padding-right: 4px;
}
.schedule-item {
	background: #ffffff;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
	padding: 16px 20px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	transition: all var(--transition-fast);
}
.schedule-item:hover {
	border-color: var(--color-brand-blue-light);
	background: #fafcfd;
}
.schedule-details h5 {
	font-size: 15px;
	margin-bottom: 4px;
}
.schedule-details p {
	font-size: 12px;
	color: var(--color-text-secondary);
}
.schedule-item .btn-join {
	height: 36px;
	padding: 0 16px;
	border-radius: var(--radius-md);
	font-size: 13px;
}

/* Student Proficiency Row matching image */
.proficiency-section {
	margin-top: 16px;
}
.proficiency-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.proficiency-item {
	background: #fafdf7; /* Default light green tint */
	border: 1px solid rgba(118, 200, 19, 0.15);
	border-radius: var(--radius-lg);
	padding: 16px 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}
.proficiency-item.working {
	background: #fffdf5;
	border-color: rgba(248, 150, 30, 0.15);
}
.proficiency-item.attention {
	background: #fef5f5;
	border-color: rgba(234, 53, 70, 0.15);
}

.student-info-col {
	display: flex;
	align-items: center;
	gap: 16px;
	width: 25%;
}
.student-avatar {
	width: 44px;
	height: 44px;
	border-radius: var(--radius-round);
	background: var(--color-border);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	color: var(--color-text-secondary);
}
.student-meta h5 {
	font-size: 15px;
	margin-bottom: 2px;
}
.student-meta p {
	font-size: 12px;
	color: var(--color-text-secondary);
}

.student-work-col {
	text-align: center;
	width: 15%;
}
.student-work-col p {
	font-size: 12px;
	color: var(--color-text-secondary);
	text-transform: uppercase;
	font-weight: 700;
	letter-spacing: 0.5px;
}
.student-work-col h6 {
	font-size: 18px;
	font-family: var(--font-headers);
}

.student-progress-col {
	width: 35%;
	display: flex;
	align-items: center;
	gap: 12px;
}
.progress-bar-bg {
	flex-grow: 1;
	height: 8px;
	background: var(--color-border);
	border-radius: var(--radius-round);
	overflow: hidden;
}
.progress-bar-fill {
	height: 100%;
	border-radius: var(--radius-round);
}
.progress-bar-fill.green { background-color: var(--color-mastered); }
.progress-bar-fill.orange { background-color: var(--color-working); }
.progress-bar-fill.red { background-color: var(--color-attention); }

.progress-text {
	font-family: var(--font-headers);
	font-weight: 800;
	font-size: 15px;
	min-width: 40px;
}

.student-status-col {
	display: flex;
	gap: 8px;
	width: 15%;
}
.mini-badge {
	width: 28px;
	height: 28px;
	border-radius: var(--radius-round);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	font-weight: 700;
	color: #ffffff;
	box-shadow: var(--shadow-sm);
}
.mini-badge.red { background-color: var(--color-attention); }
.mini-badge.orange { background-color: var(--color-working); }
.mini-badge.green { background-color: var(--color-mastered); }

.student-action-col {
	width: 10%;
	text-align: right;
}
.student-action-col .btn-msg {
	height: 36px;
	font-size: 13px;
	padding: 0 16px;
}

/* ==========================================================================
   ROLE/TIER SPECIFIC STYLES
   ========================================================================== */

/* 1. EARLY YEARS (Ages 3-5) Play-based layout */
.early-years-dashboard {
	background: linear-gradient(135deg, #fffbeb 0%, #fff7ed 100%);
	min-height: calc(100vh - 70px);
	padding: 32px;
}

.ey-title {
	text-align: center;
	font-size: 32px;
	color: var(--color-working-dark);
	margin-bottom: 24px;
	text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.ey-timeline-scroll {
	display: flex;
	gap: 24px;
	overflow-x: auto;
	padding: 20px 4px;
	scroll-snap-type: x mandatory;
}

.ey-card {
	flex: 0 0 300px;
	scroll-snap-align: start;
	background: #ffffff;
	border: 6px solid var(--color-border);
	border-radius: var(--radius-xl);
	padding: 24px;
	text-align: center;
	box-shadow: var(--shadow-lg);
	cursor: pointer;
	transition: all var(--transition-slow);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
}
.ey-card:hover {
	transform: scale(1.05) rotate(1deg);
	border-color: var(--color-working);
	box-shadow: var(--shadow-xl);
}
.ey-card .ey-icon {
	font-size: 72px;
	margin-bottom: 8px;
	animation: floatReward 4s ease-in-out infinite;
}
.ey-card h3 {
	font-size: 22px;
	color: var(--color-text-primary);
}
.ey-card .ey-time {
	background: var(--color-working-light);
	color: var(--color-working-dark);
	padding: 6px 16px;
	border-radius: var(--radius-round);
	font-weight: 700;
	font-size: 14px;
}

/* Scribble Drawing Tool Widget */
.drawing-widget {
	border: 3px dashed var(--color-border);
	border-radius: var(--radius-lg);
	background: #ffffff;
	padding: 16px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
}
.ey-canvas {
	background: #fafcfd;
	border: 2px solid var(--color-border);
	border-radius: var(--radius-md);
	cursor: crosshair;
	touch-action: none;
}
.drawing-controls {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
	justify-content: center;
}
.color-swatch {
	width: 40px;
	height: 40px;
	border-radius: var(--radius-round);
	cursor: pointer;
	border: 3px solid #ffffff;
	box-shadow: var(--shadow-sm);
	transition: transform var(--transition-fast);
}
.color-swatch:hover, .color-swatch.active {
	transform: scale(1.15);
	box-shadow: 0 0 0 3px var(--color-brand-blue);
}

/* Large voice recording circle button */
.voice-recorder-circle {
	width: 120px;
	height: 120px;
	border-radius: var(--radius-round);
	background: var(--color-attention-light);
	border: 6px solid var(--color-attention);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 40px;
	cursor: pointer;
	transition: all var(--transition-slow);
	box-shadow: var(--shadow-lg);
	animation: pulseNormal 2s infinite;
}
.voice-recorder-circle.recording {
	background: var(--color-attention);
	color: #ffffff;
	animation: pulseRecording 1s infinite;
	border-color: #ffffff;
}
@keyframes pulseNormal {
	0% { box-shadow: 0 0 0 0 rgba(234, 53, 70, 0.4); }
	70% { box-shadow: 0 0 0 15px rgba(234, 53, 70, 0); }
	100% { box-shadow: 0 0 0 0 rgba(234, 53, 70, 0); }
}
@keyframes pulseRecording {
	0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(234, 53, 70, 0.7); }
	70% { transform: scale(1.05); box-shadow: 0 0 0 20px rgba(234, 53, 70, 0); }
	100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(234, 53, 70, 0); }
}

/* Sound play card */
.sound-instruction-btn {
	background: var(--color-brand-blue-light);
	color: var(--color-brand-blue);
	border-radius: var(--radius-round);
	padding: 8px 24px;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	border: 2px solid var(--color-brand-blue);
	display: inline-flex;
	align-items: center;
	gap: 8px;
	animation: floatReward 3s ease-in-out infinite;
}

/* Parent Lock prompt */
.parent-lock-modal {
	max-width: 400px;
}
.parent-lock-input {
	font-size: 24px;
	text-align: center;
	letter-spacing: 12px;
	height: 56px;
}

/* 2. PRIMARY (Ages 6-11) Structured/Gamified layout */
.primary-rewards-panel {
	background: linear-gradient(135deg, #eff6ff 0%, #e0f2fe 100%);
	border-radius: var(--radius-lg);
	padding: 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.badge-case {
	display: flex;
	gap: 16px;
}
.badge-slot {
	width: 60px;
	height: 60px;
	border-radius: var(--radius-round);
	background: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 28px;
	box-shadow: var(--shadow-sm);
	position: relative;
}
.badge-slot.empty {
	background: rgba(255, 255, 255, 0.4);
	border: 2px dashed var(--color-text-muted);
}

/* 3. SECONDARY (Ages 12-16) Academic dashboard */
.essay-dropzone {
	border: 2px dashed var(--color-brand-blue);
	border-radius: var(--radius-lg);
	background: var(--color-brand-blue-light);
	padding: 32px;
	text-align: center;
	cursor: pointer;
	transition: background var(--transition-fast);
}
.essay-dropzone:hover {
	background: #dbeafe;
}

/* SVG Grade progression graphs */
.svg-graph-container {
	width: 100%;
	height: 200px;
	background: #ffffff;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
	padding: 16px;
}

/* 4. TEACHER VIEW Grading panels */
.grading-panel {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 24px;
}
@media (max-width: 768px) {
	.grading-panel {
		grid-template-columns: 1fr;
	}
}

/* 5. AUTHENTICATION SCREENS (PIN Circular Numpad) */
.auth-container,
.auth-container * {
	animation: none !important;
	transition: none !important;
}
.auth-container {
	max-width: 440px;
	width: 100%;
	margin: 80px auto;
	padding: 24px;
}
.auth-logo-box {
	text-align: center;
	margin-bottom: 32px;
}
.pin-numpad {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
	max-width: 280px;
	margin: 24px auto 0;
}
.pin-btn {
	width: 70px;
	height: 70px;
	border-radius: var(--radius-round);
	border: 2px solid var(--color-border);
	background: #ffffff;
	font-size: 24px;
	font-family: var(--font-headers);
	font-weight: 700;
	color: var(--color-text-primary);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: var(--shadow-sm);
	transition: all var(--transition-fast);
}
.pin-btn:hover {
	background: var(--color-brand-blue-light);
	border-color: var(--color-brand-blue);
	color: var(--color-brand-blue);
	transform: scale(1.05);
}
.pin-btn:active {
	transform: scale(0.95);
}

.pin-display {
	display: flex;
	justify-content: center;
	gap: 16px;
	margin: 24px 0;
}
.pin-dot {
	width: 18px;
	height: 18px;
	border-radius: var(--radius-round);
	border: 2px solid var(--color-text-secondary);
	transition: background var(--transition-fast);
}
.pin-dot.filled {
	background: var(--color-brand-blue);
	border-color: var(--color-brand-blue);
}

/* Confetti Container */
#confetti-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	pointer-events: none;
	z-index: 9999;
	overflow: hidden;
}
.confetti-piece {
	position: absolute;
	width: 12px;
	height: 12px;
	background: #ffd700;
	animation: fallConfetti 4s linear forwards;
}
@keyframes fallConfetti {
	0% { transform: translateY(-50px) rotate(0deg); opacity: 1; }
	100% { transform: translateY(105vh) rotate(720deg); opacity: 0; }
}

/* Sticker rewards box */
.sticker-book {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
	gap: 16px;
	margin-top: 16px;
}
.sticker-item {
	border: 2px solid var(--color-border);
	border-radius: var(--radius-md);
	background: #ffffff;
	padding: 12px;
	text-align: center;
	transition: transform var(--transition-slow);
}
.sticker-item:hover {
	transform: scale(1.2) rotate(-5deg);
	border-color: var(--color-working);
}
.sticker-item .sticker-icon {
	font-size: 36px;
}

/* Message timeline styling */
.messages-box {
	height: 350px;
	overflow-y: auto;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
	padding: 16px;
	background: #ffffff;
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 16px;
}
.message-bubble {
	max-width: 70%;
	padding: 12px 16px;
	border-radius: var(--radius-md);
	font-size: 14px;
	line-height: 1.4;
}
.message-bubble.sent {
	background: var(--color-brand-blue);
	color: #ffffff;
	align-self: flex-end;
	border-bottom-right-radius: 2px;
}
.message-bubble.received {
	background: var(--color-bg);
	color: var(--color-text-primary);
	align-self: flex-start;
	border-bottom-left-radius: 2px;
}
.message-meta {
	font-size: 10px;
	margin-top: 4px;
	opacity: 0.8;
}

/* Initial Fullscreen Loader */
.initial-loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 100vh;
	background-color: var(--color-bg);
	gap: 16px;
}
.loader-spinner {
	width: 48px;
	height: 48px;
	border: 5px solid var(--color-border);
	border-top-color: var(--color-brand-blue);
	border-radius: var(--radius-round);
	animation: spinLoader 1s linear infinite;
}
@keyframes spinLoader {
	to { transform: rotate(360deg); }
}

/* 9. Toast Notification Container */
#alc-toast-container {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 99999;
	display: flex;
	flex-direction: column;
	gap: 10px;
	pointer-events: none;
	max-width: 460px;
	width: calc(100vw - 48px);
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE SYSTEM (Apple HIG Touch Optimization)
   ========================================================================== */

.mobile-header-bar {
	display: none;
	height: 56px;
	background: rgba(255, 255, 255, 0.85);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border-bottom: 1px solid var(--color-border);
	padding: 0 16px;
	align-items: center;
	justify-content: space-between;
	position: sticky;
	top: 0;
	z-index: 1000;
	width: 100%;
}

@media (max-width: 900px) {
	.app-shell {
		flex-direction: column;
		min-height: 100vh;
	}

	.mobile-header-bar {
		display: flex;
	}

	.app-sidebar {
		width: 100%;
		height: calc(100vh - 56px);
		position: fixed;
		top: 56px;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 999;
		background: rgba(255, 255, 255, 0.98);
		backdrop-filter: blur(30px);
		-webkit-backdrop-filter: blur(30px);
		transform: translateX(-100%);
		transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
		overflow-y: auto;
		padding: 20px 16px 32px;
		border-right: none;
		border-bottom: 1px solid var(--color-border);
	}

	.app-sidebar.mobile-open {
		transform: translateX(0);
	}

	#main-view-viewport {
		padding: 16px 14px;
		height: auto;
		min-height: calc(100vh - 56px);
		overflow-x: hidden;
	}

	.dashboard-container {
		padding: 0;
		gap: 20px;
	}

	.dashboard-title-row {
		flex-direction: column;
		align-items: flex-start;
		gap: 12px;
	}

	.dashboard-grid-top {
		grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
		gap: 12px;
	}

	.dashboard-split-grid {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.tools-grid {
		grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
		gap: 10px;
	}

	.tool-card {
		padding: 16px 12px;
	}

	.card {
		padding: 18px 14px;
		border-radius: 18px;
	}

	.modal-content {
		padding: 20px 16px;
		max-width: 95%;
		border-radius: 20px;
		max-height: 92vh;
	}

	/* Responsive Tables */
	table {
		display: block;
		width: 100%;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		white-space: nowrap;
	}

	.btn {
		min-height: 40px;
		padding: 8px 14px;
		font-size: 13px;
	}

	.form-control {
		min-height: 42px;
		font-size: 14px;
	}

	.apple-segmented-control {
		width: 100%;
		display: flex;
		overflow-x: auto;
	}

	.apple-segmented-control button {
		flex: 1;
		white-space: nowrap;
		padding: 8px 10px;
		font-size: 11px;
	}

	.messages-box {
		height: 300px;
	}
	.message-bubble {
		max-width: 88%;
	}

	#alc-toast-container {
		bottom: 16px;
		right: 16px;
		left: 16px;
		max-width: none;
	}

	/* ==========================================================================
	   UNIVERSAL MOBILE STACKING OVERRIDES FOR ALL DASHBOARD VIEWS
	   ========================================================================== */
	div[style*="grid-template-columns: 1fr 1fr"],
	div[style*="grid-template-columns:1fr 1fr"],
	div[style*="grid-template-columns: 2fr 1fr"],
	div[style*="grid-template-columns:2fr 1fr"],
	div[style*="grid-template-columns: 2fr 1fr 1fr"],
	div[style*="grid-template-columns:2fr 1fr 1fr"],
	div[style*="grid-template-columns: 280px 1fr"],
	div[style*="grid-template-columns:280px 1fr"],
	div[style*="grid-template-columns: 320px 1fr"],
	div[style*="grid-template-columns:320px 1fr"],
	div[style*="grid-template-columns: repeat(auto-fit, minmax(280px, 1fr))"],
	div[style*="grid-template-columns:repeat(auto-fit, minmax(280px, 1fr))"] {
		grid-template-columns: 1fr !important;
		height: auto !important;
		min-height: 0 !important;
		max-height: none !important;
	}

	div[style*="grid-template-columns:repeat(4, 1fr)"],
	div[style*="grid-template-columns: repeat(4, 1fr)"] {
		grid-template-columns: repeat(2, 1fr) !important;
	}

	/* Messages & Chat Sidebar Stack */
	.card[style*="grid-template-columns:320px 1fr"],
	.card[style*="grid-template-columns: 320px 1fr"] {
		display: flex !important;
		flex-direction: column !important;
		height: auto !important;
		min-height: 0 !important;
		max-height: none !important;
	}

	/* Force Flex Wrap on Header Action Bars */
	.dashboard-title-row,
	.d-flex:not(.nav-tabs):not(.apple-segmented-control) {
		flex-wrap: wrap !important;
		gap: 12px !important;
	}
}

@media (max-width: 480px) {
	.dashboard-grid-top {
		grid-template-columns: 1fr 1fr !important;
	}

	div[style*="grid-template-columns:repeat(4, 1fr)"],
	div[style*="grid-template-columns: repeat(4, 1fr)"] {
		grid-template-columns: 1fr !important;
	}

	.brand-title {
		font-size: 15px;
	}

	.nav-tab {
		height: 42px;
		font-size: 13px;
	}
}
