/* Import Google Font & Symbols */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Roboto+Mono:wght@400;500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');

/* --- CSS Variables (Dark Mode Only) --- */
:root {
	--font-family-sans: 'Inter', sans-serif;
	--font-family-mono: 'Roboto Mono', monospace;
	--sidebar-width-expanded: 240px;
	--sidebar-width-collapsed: 65px;
	--header-height: 60px;
	--transition-speed: 0.25s;
	--border-radius: 16px;

	/* Dark Theme Variables */
	--bg-color: #202124;
	--text-color: #e8eaed;
	--text-secondary-color: #9aa0a6;
	--border-color: #3c4043;
	--panel-bg: #292a2d;
	--sidebar-bg: #292a2d;
	--sidebar-text: #bdc1c6;
	--sidebar-icon-color: #9aa0a6;
	--sidebar-hover-bg: #3c4043;
	--sidebar-active-bg: #313a4c;
	--sidebar-active-text: #8ab4f8;
	--sidebar-active-icon-color: #8ab4f8;
	--input-bg: #3c4043;
	--input-border: #5f6368;
	--input-border-radius: 10px;
	--input-focus-border: #8ab4f8;
	--input-focus-shadow: rgba(138, 180, 248, 0.15);
	--button-bg: #8ab4f8;
	--button-hover-bg: #a1c2fa;
	--button-text: #202124;
	--icon-button-text: #9aa0a6;
	--icon-button-hover-bg: #3c4043;
	--icon-button-hover-text: #e8eaed;
	--link-color: #8ab4f8;
	--gradient-start: #8ab4f8;
	--gradient-end: #81c995;
	--editor-title-color: #bdc1c6;
	--scrollbar-thumb-bg: #5f6368;
	--scrollbar-track-bg: #3c4043;
	--tooltip-bg: #e8eaed;
	--tooltip-text: #202124;
	--loading-text-color: #9aa0a6;
	--cm-bg: #292a2d; /* CodeMirror background */
	--cm-border: #3c4043;
	--error-bg: rgba(248, 138, 138, 0.1);
	--error-border: #f88a8a;
	--error-text: #f8cccc;
	--overlay-bg: rgba(0, 0, 0, 0.5);
	--editor-container-border: #3c4043;
	/* --select-arrow-color: #9aa0a6; Removed */
}

/* --- Base Styles --- */
*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}
html,
body {
	height: 100%;
	overflow: hidden;
}

body {
	font-family: var(--font-family-sans);
	background-color: transparent;
	color: var(--text-color);
	line-height: 1.6;
	font-size: 15px;
}

/* --- App Layout --- */
.app-layout {
	display: flex;
	height: 100vh;
	background-color: var(--bg-color);
	position: relative;
	overflow: hidden;
}

/* --- Top / Profile Bar --- */
.header-container {
	display: flex;
	justify-content: space-between;
	align-items: center;
	width: 100%;
	padding: 10px 0;
}

.profile-container {
	display: flex;
	align-items: center;
	gap: 10px;
}

.profile-link {
	display: flex;
	align-items: center;
	text-decoration: none;
	color: inherit;
	transition: color var(--transition-speed) ease;
}

.profile-link:hover {
	color: var(--link-color);
}

.profile-image {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background-color: #ddd; /* Placeholder color */
}

.profile-name {
	font-weight: 500;
	color: var(--text-color);
	font-size: 1rem;
	line-height: 1;
	padding: 0 5px;
}

.profile-name:hover {
	color: var(--link-color);
	text-decoration: underline;
}

/* --- Google Material Symbols Base Style --- */
.material-symbols-outlined {
	font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
	font-size: 1.25rem;
	vertical-align: middle;
	line-height: 1;
}

/* --- Sidebar --- */
.sidebar {
	width: var(--sidebar-width-expanded);
	background-color: var(--sidebar-bg);
	display: flex;
	flex-direction: column;
	transition: width var(--transition-speed) ease;
	position: relative;
	flex-shrink: 0;
	z-index: 10;
}
.sidebar.collapsed {
	width: var(--sidebar-width-collapsed);
}
.sidebar-header {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	padding: 0 12px;
	height: var(--header-height);
	flex-shrink: 0;
	gap: 10px;
}
.toggle-btn {
	background: none;
	border: none;
	color: var(--sidebar-icon-color);
	font-size: 1.1rem;
	cursor: pointer;
	padding: 8px;
	line-height: 1;
	border-radius: 50%;
	transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.toggle-btn:hover {
	background-color: var(--sidebar-hover-bg);
	color: var(--text-color);
}
.desktop-toggle-btn {
	/* Default styles are fine */
}
.mobile-toggle-btn {
	display: none;
	margin-right: 16px;
}

/* Sidebar Title Styling */
.sidebar-main-title {
	font-size: 1rem;
	font-weight: 600;
	color: var(--text-color);
	white-space: nowrap;
	overflow: hidden;
	flex-grow: 1;
	display: none; /* Hide by default */
}

.sidebar-main-title .gradient-text {
	/* Gradient only on Sandbox part */
	background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	font-weight: 600;
}

.tenant-list-title {
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--text-secondary-color);
	padding: 16px 22px 4px 22px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	white-space: nowrap;
	overflow: hidden;
	transition: opacity var(--transition-speed) ease;
}
.sidebar.collapsed .tenant-list-title {
	opacity: 0;
	height: 0;
	padding: 0;
	margin: 0;
	overflow: hidden;
}
.tenant-list {
	list-style: none;
	flex-grow: 1;
	overflow-y: auto;
	padding: 0;
	margin-top: 4px;
}
.tenant-list li a {
	display: flex;
	align-items: center;
	padding: 8px 22px;
	margin: 2px 8px;
	color: var(--sidebar-text);
	text-decoration: none;
	white-space: nowrap;
	overflow: hidden;
	border-radius: var(--border-radius);
	transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
	position: relative;
}
.tenant-list li a .material-symbols-outlined {
	margin-right: 18px;
	font-size: 1.1rem;
	width: 20px;
	text-align: center;
	flex-shrink: 0;
	color: var(--sidebar-icon-color);
	transition: color var(--transition-speed) ease;
}
.tenant-list li a span:not(.material-symbols-outlined) {
	transition: opacity var(--transition-speed) ease;
	opacity: 1;
	font-size: 0.9rem;
}
.sidebar.collapsed .tenant-list li a {
	margin: 2px 4px;
	padding: 8px 14px;
	justify-content: center;
}
.sidebar.collapsed .tenant-list li a span:not(.material-symbols-outlined) {
	opacity: 0;
	width: 0;
	display: none;
}
.sidebar.collapsed .tenant-list li a .material-symbols-outlined {
	margin-right: 0;
}
.tenant-list li a:hover {
	background-color: var(--sidebar-hover-bg);
	color: var(--text-color);
}
.tenant-list li a.active {
	background-color: var(--sidebar-active-bg);
	color: var(--sidebar-active-text);
	font-weight: 500;
}
.tenant-list li a.active .material-symbols-outlined {
	color: var(--sidebar-active-icon-color);
}
.sidebar.collapsed .tenant-list li a::after {
	content: attr(title);
	position: absolute;
	left: calc(var(--sidebar-width-collapsed) + 5px);
	top: 50%;
	transform: translateY(-50%);
	background-color: var(--tooltip-bg);
	color: var(--tooltip-text);
	padding: 4px 8px;
	border-radius: 4px;
	font-size: 0.8rem;
	white-space: nowrap;
	opacity: 0;
	visibility: hidden;
	transition: opacity var(--transition-speed) ease, visibility var(--transition-speed) ease;
	pointer-events: none;
	z-index: 100;
}
.sidebar.collapsed .tenant-list li a:hover::after {
	opacity: 1;
	visibility: visible;
	transition-delay: 0.3s;
}

/* --- Main Content Area --- */
.main-content {
	flex-grow: 1;
	display: flex;
	flex-direction: column;
	overflow-y: auto;
	overflow-x: hidden;
	background-color: transparent;
}

.main-header {
	padding: 0 24px;
	flex-shrink: 0;
	height: var(--header-height);
	display: flex;
	align-items: center;
	background-color: transparent; /* Removed background */
	position: relative;
	z-index: 1;
}
.page-title {
	font-size: 1.25rem;
	font-weight: 500;
	color: var(--text-color);
	margin-left: 5px;
}
.page-title .gradient-text {
	/* Ensure gradient applies here too */
	background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	font-weight: 600;
}

/* --- Content Split --- */
.content-split {
	display: flex;
	flex-grow: 1;
	overflow: hidden;
	padding: 16px;
	padding-top: 0px;
	gap: 16px;
}

/* --- Form Wrapper (for forms managed by FormInstanceManager) --- */
.form-wrapper {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	min-height: 0; /* Critical for flex scrolling - allows children to shrink below content size */
}

.form-panel {
	width: 33.33%;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transition: width var(--transition-speed) ease;
	border: 1px solid var(--border-color);
	border-radius: var(--border-radius);
}
.editor-panel {
	width: 66.67%;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transition: width var(--transition-speed) ease, opacity var(--transition-speed) ease;
}

/* Panel header within form panel */
.form-panel .panel-header {
	padding: 10px 16px;
	border-bottom: 1px solid var(--border-color);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	flex-shrink: 0;
	min-height: 50px;
	background-color: var(--panel-bg);
	border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.panel-header {
	padding: 10px 16px;
	border-bottom: 1px solid var(--border-color);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	flex-shrink: 0;
	min-height: 50px;
	background-color: var(--panel-bg);
	border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.panel-title {
	font-size: 1.1rem;
	font-weight: 600;
	color: var(--text-color);
	margin: 0;
}
.app-selector label {
	margin-right: 8px;
	font-size: 0.85rem;
	font-weight: 500;
	color: var(--text-secondary-color);
}

/* Select Dropdown Styling - REVERTED */
.app-selector select,
.form-container .form-group select {
	min-width: 120px;
	padding: 6px 10px; /* Reverted padding */
	border: 1px solid var(--input-border);
	border-radius: var(--input-border-radius);
	background-color: var(--input-bg);
	color: var(--text-color);
	font-size: 0.9rem;
	transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
	outline: none;
	appearance: revert; /* Use browser default */
	-webkit-appearance: revert;
	-moz-appearance: revert;
	background-image: none; /* Remove custom background */
	mask-image: none; /* Remove mask */
	-webkit-mask-image: none;
	cursor: pointer;
}

.app-selector select:focus,
.form-container .form-group select:focus {
	border-color: var(--input-focus-border);
	box-shadow: 0 0 0 2px var(--input-focus-shadow);
}

/* --- Form Container --- */
.form-container {
	flex-grow: 1;
	padding: 24px;
	overflow-y: auto;
}
.form-container.scrollable {
	max-height: 100%;
	height: 100%;
}
.loading-message {
	color: var(--loading-text-color);
	font-style: italic;
	text-align: center;
	padding: 40px 20px;
}

/* --- Error Message Styling --- */
.form-container .error {
	background-color: var(--error-bg);
	border: 1px solid var(--error-border);
	color: var(--error-text);
	padding: 12px 16px;
	border-radius: var(--border-radius);
	margin-bottom: 1.5rem;
	font-size: 0.9rem;
}
.form-container .error p {
	margin: 0;
	padding: 0;
	line-height: 1.4;
}
.form-container .error strong {
	color: var(--error-border);
	margin-right: 5px;
}

/* --- Integrated Editor Styling --- */
.integrated-editor-container {
	flex-grow: 1;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--editor-container-border);
	border-radius: var(--border-radius);
	background-color: transparent; /* Removed background */
}

.code-toolbar {
	padding: 10px 16px;
	border-bottom: 1px solid var(--editor-container-border);
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
	min-height: 50px;
	background-color: transparent; /* Ensure transparent */
	justify-content: flex-start;
}
/* Filename Label Styling */
.filename-label {
	font-size: 0.85rem;
	font-weight: 500;
	color: var(--text-secondary-color);
	margin-right: 4px;
	white-space: nowrap;
}
.filename-input {
	flex-grow: 1;
	margin-right: 10px;
	padding: 6px 10px;
	border: 1px solid var(--input-border);
	border-radius: var(--input-border-radius);
	background-color: var(--input-bg);
	color: var(--text-color);
	font-size: 0.9rem;
	transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
	outline: none;
}
.filename-input:focus {
	border-color: var(--input-focus-border);
	box-shadow: 0 0 0 2px var(--input-focus-shadow);
}
.icon-button {
	background: transparent;
	border: none;
	color: var(--icon-button-text);
	font-size: 1.1rem;
	padding: 6px;
	cursor: pointer;
	border-radius: 50%;
	transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
	line-height: 1;
	width: 32px;
	height: 32px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.icon-button .material-symbols-outlined {
	font-size: 1.2rem;
}
.icon-button:hover {
	background-color: var(--icon-button-hover-bg);
	color: var(--icon-button-hover-text);
}

/* Form Action Button - appears inline with form elements */
.form-action-button {
	background: transparent;
	border: 1px solid var(--input-border);
	color: var(--icon-button-text);
	font-size: 0.9rem;
	padding: 8px 16px;
	cursor: pointer;
	border-radius: var(--input-border-radius);
	transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease, border-color var(--transition-speed) ease;
	line-height: 1.4;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 0.5rem;
	margin-bottom: 1.25rem;
	font-family: var(--font-family-sans);
	font-weight: 500;
}
.form-action-button .material-symbols-outlined {
	font-size: 1.1rem;
}
.form-action-button:hover {
	background-color: var(--icon-button-hover-bg);
	color: var(--icon-button-hover-text);
	border-color: var(--input-focus-border);
}
.form-action-button:focus {
	outline: none;
	border-color: var(--input-focus-border);
	box-shadow: 0 0 0 2px var(--input-focus-shadow);
}

.editor-output-split {
	flex-grow: 1;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	padding: 0;
	gap: 0;
}

.code-editor-area,
.output-area {
	flex: 1;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	position: relative;
}

/* Editor Area Titles */
.editor-area-title {
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--editor-title-color);
	padding: 10px 16px 10px 16px;
	display: block;
	flex-shrink: 0;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	background-color: transparent;
	border-bottom: 1px solid var(--editor-container-border); /* Add border */
}
.output-area .editor-area-title {
	border-top: 1px solid var(--editor-container-border); /* Ensure separator */
}

/* --- CodeMirror --- */
.CodeMirror {
	flex-grow: 1 !important;
	height: 100% !important;
	border: none;
	font-family: var(--font-family-mono);
	font-size: 0.85rem;
	background: var(--cm-bg); /* Add background color here */
	color: var(--text-color);
	border-radius: 0 0 var(--border-radius) var(--border-radius);
}
.code-editor-area .CodeMirror {
	border-radius: 0;
}

.CodeMirror-scroll {
	min-height: 100px;
	background-color: var(--cm-bg);
}
.CodeMirror-gutters {
	background-color: var(--cm-bg) !important;
	border-right: 1px solid var(--cm-border) !important;
}
.cm-s-monokai.CodeMirror {
	background-color: var(--cm-bg);
	color: var(--text-color);
}
.cm-s-monokai .CodeMirror-gutters {
	background: var(--cm-bg);
	border-right: 1px solid var(--cm-border);
}
.cm-s-monokai .CodeMirror-guttermarker,
.cm-s-monokai .CodeMirror-guttermarker-subtle,
.cm-s-monokai .CodeMirror-linenumber {
	color: var(--text-secondary-color);
}
.cm-s-monokai .CodeMirror-cursor {
	border-left: 1px solid var(--text-color) !important;
}

/* --- Form Styles --- */
.form-container form {
	border: none;
	padding: 0;
	margin: 0;
	max-width: none;
	box-shadow: none;
	background-color: transparent;
}
.form-container fieldset {
	border: 1px solid var(--border-color);
	padding: 1rem 1.5rem 1.5rem 1.5rem;
	margin-bottom: 1.5rem;
	border-radius: var(--border-radius);
}
.form-container legend {
	font-weight: 600;
	padding: 0 0.5rem;
	color: var(--text-color);
	font-size: 1rem;
}
.form-container .form-group {
	margin-bottom: 1.25rem;
}
.form-container .form-group label:not(.radio-option label):not(.form-group-checkbox label),
.form-container .form-group .group-label {
	display: block;
	margin-bottom: 0.5rem;
	font-weight: 500;
	font-size: 0.85rem;
	color: var(--text-secondary-color);
}
.form-container .form-group input[type='text'],
.form-container .form-group input[type='file'],
.form-container .form-group input[type='number'],
.form-container .form-group input[type='email'],
.form-container .form-group input[type='password'],
.form-container .form-group input[type='date'],
.form-container .form-group select,
.form-container .form-group textarea {
	width: 100%;
	padding: 0.6rem 0.8rem;
	border: 1px solid var(--input-border);
	border-radius: var(--input-border-radius);
	box-sizing: border-box;
	font-size: 0.95rem;
	color: var(--text-color);
	background-color: var(--input-bg);
	transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
	outline: none;
}
/* Reverted select padding */
.form-container .form-group select {
	padding: 0.6rem 0.8rem;
}

.form-container .form-group input:focus,
.form-container .form-group select:focus,
.form-container .form-group textarea:focus {
	border-color: var(--input-focus-border);
	box-shadow: 0 0 0 2px var(--input-focus-shadow);
}
.form-container .form-group-checkbox label,
.form-container .form-group-radio .radio-option label {
	display: flex;
	align-items: center;
	font-weight: 400;
	font-size: 0.95rem;
	color: var(--text-color);
	cursor: pointer;
	padding: 4px 0;
}
.form-container .form-group-checkbox input[type='checkbox'],
.form-container .form-group-radio input[type='radio'] {
	margin-right: 0.75rem;
	width: 1.1em;
	height: 1.1em;
	flex-shrink: 0;
	accent-color: var(--button-bg);
	cursor: pointer;
}
.form-container .form-group-checkbox input[type='checkbox']:focus,
.form-container .form-group-radio input[type='radio']:focus {
	box-shadow: 0 0 0 3px var(--input-focus-shadow);
	outline: none;
}
.form-container .form-group-radio .radio-option {
	margin-bottom: 0.1rem;
}
.form-container .form-group-radio .radio-option:last-child {
	margin-bottom: 0;
}
.form-container .form-group-star-rating {
	margin-bottom: 1rem;
}
.form-container .form-group-star-rating .group-label {
	margin-bottom: 0.5rem;
}
.form-container .form-group-star-rating .stars-input-container {
	display: flex;
	gap: 0.15rem;
	align-items: center;
}
.form-container .form-group-star-rating span {
	font-size: 1.6rem;
	cursor: pointer;
	user-select: none;
	color: var(--input-border);
	transition: color 0.1s ease-in-out;
}

/* --- Table Styling --- */
table {
	border-collapse: collapse;
	width: 100%;
	margin-bottom: 1.5rem;
	border: 1px solid var(--border-color);
	border-radius: var(--border-radius);
	overflow: visible; /* Changed from hidden to allow dropdowns to overflow */
	background-color: var(--panel-bg);
}

thead {
	background-color: var(--sidebar-active-bg);
	color: var(--text-color);
}

th {
	padding: 12px 15px;
	font-weight: 600;
	font-size: 0.9rem;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	border-bottom: 2px solid var(--border-color);
}

td {
	padding: 10px 15px;
	border-bottom: 1px solid var(--border-color);
	font-size: 0.95rem;
}

tr:last-child td {
	border-bottom: none;
}

tr:nth-child(even) {
	background-color: rgba(60, 64, 67, 0.3);
}

tr:hover {
	background-color: var(--sidebar-hover-bg);
}

.form-table {
	margin-top: 0.5rem;
	margin-bottom: 1.5rem;
}

/* --- Meeting notes - should go elsewhere (where? how?) --- */
.meeting-notes {
	background-color: var(--panel-bg);
	border: 1px solid var(--border-color);
	border-radius: var(--border-radius);
	padding: 24px;
	margin-bottom: 1.5rem;
	overflow-y: auto;
	max-height: 500px;
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.meeting-note {
	background-color: transparent;
	border: 1px solid var(--border-color);
	border-radius: var(--border-radius);
	padding: 18px 20px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
	box-shadow: none;
	position: relative;
}

.meeting-note:hover {
	border-color: var(--input-focus-border);
	box-shadow: 0 2px 8px rgba(138,180,248,0.07);
}

.meeting-note .company-name {
	font-weight: 600;
	font-size: 1.05rem;
	color: var(--text-color);
	margin-bottom: 2px;
	display: flex;
	align-items: center;
	gap: 10px;
}

/* Note header: left/right alignment */
.note-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 0.5rem;
}
.note-company-name-left {
	font-weight: 600;
	color: var(--text-color);
	font-size: 1.05rem;
}
.note-last-updated-right {
	color: var(--text-secondary-color);
	font-size: 0.92rem;
	font-style: italic;
	white-space: nowrap;
}

/* Contact Circles inside .note-contacts */
.meeting-note .note-contacts .contact-circle {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1rem;
	font-weight: 600;
	box-shadow: 0 1px 4px rgba(0,0,0,0.10);
	margin-right: 4px;
	border: 2px solid var(--panel-bg);
	overflow: hidden;
	/* Optionally add a transition for hover effect */
	transition: box-shadow 0.18s, border-color 0.18s;
}

.note-contacts {
	display: flex;
	gap: 0.5rem;
	margin-bottom: 1rem;
}

.meeting-note .note-content {
	color: var(--text-secondary-color);
	font-size: 0.97rem;
    border-left: 4px solid #667eea;
	padding: 1rem;
 	line-height: 1.6;
	margin-bottom: 4px;
	white-space: pre-line;
}

.meeting-note .note-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 0.85rem;
	color: var(--text-secondary-color);
	margin-top: 2px;
}

.meeting-note .last-updated {
	font-style: italic;
}

.meeting-note .actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.view-note-btn.icon-button {
	color: var(--icon-button-text);
	background: transparent;
	border: none;
	padding: 6px;
	border-radius: 50%;
	transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
	font-size: 1.1rem;
	width: 32px;
	height: 32px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.view-note-btn.icon-button .material-symbols-outlined {
	font-size: 1.2rem;
}

.view-note-btn.icon-button:hover {
	background-color: var(--icon-button-hover-bg);
	color: var(--icon-button-hover-text);
}

/* Responsive adjustments for meeting notes */
@media (max-width: 991.98px) {
	.meeting-notes {
		padding: 12px;
		max-height: 300px;
	}
	.meeting-note {
		padding: 12px 12px;
	}
}

/* --- Scrollbar Styling --- */
::-webkit-scrollbar {
	width: 10px;
	height: 10px;
}
::-webkit-scrollbar-track {
	background: var(--scrollbar-track-bg);
}
::-webkit-scrollbar-thumb {
	background: var(--scrollbar-thumb-bg);
	border-radius: 5px;
	border: 2px solid var(--scrollbar-track-bg);
}
::-webkit-scrollbar-thumb:hover {
	background: var(--text-secondary-color);
}

/* --- Overlay for Mobile Menu --- */
.overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: var(--overlay-bg);
	opacity: 0;
	visibility: hidden;
	transition: opacity var(--transition-speed) ease, visibility var(--transition-speed) ease;
	z-index: 999;
}
.overlay.active {
	opacity: 1;
	visibility: visible;
}

/* Progress Modal */
.progress-modal {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 1000;
	max-width: 700px;
	width: 90%;
	max-height: 80vh;
	overflow-y: auto;
}

.progress-modal .panel {
	margin: 0;
}

.progress-modal .panel-content {
	max-height: 60vh;
	overflow-y: auto;
}

/* --- Action Dropdown Menu --- */
.action-dropdown-menu {
	background-color: var(--panel-bg);
	border: 1px solid var(--border-color);
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.action-dropdown-item {
	background-color: var(--panel-bg);
	color: var(--text-color);
}

.action-dropdown-item:hover {
	background-color: var(--sidebar-hover-bg);
}

.action-dropdown-item:first-child {
	border-radius: 8px 8px 0 0;
}

.action-dropdown-item:last-child {
	border-radius: 0 0 8px 8px;
}

.action-dropdown-item:only-child {
	border-radius: 8px;
}

/* --- Responsiveness --- */
@media (max-width: 991.98px) {
	.content-split {
		flex-direction: column;
		margin: 8px;
		gap: 8px;
		border-radius: var(--border-radius);
		border: solid var(--border-color) 1px;
		padding: 0;
	}
	.editor-panel {
		display: none;
	}
	.form-panel {
		width: 100%;
		border-right: none;
		border: none;
		border-radius: 0;
	}
	.form-panel .panel-header {
		border-radius: 0;
	}

	.sidebar {
		position: fixed;
		height: 100%;
		top: 0;
		left: calc(-1 * var(--sidebar-width-expanded));
		width: var(--sidebar-width-expanded);
		z-index: 1000;
		transition: left var(--transition-speed) ease;
		box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
	}
	.sidebar.collapsed {
		width: var(--sidebar-width-expanded);
	}
	.sidebar.sidebar-visible-mobile {
		left: 0;
	}

	.desktop-toggle-btn {
		display: none;
	}
	.mobile-toggle-btn {
		display: inline-flex;
	}

	.main-content {
		width: 100%;
		transition: none;
	}
	.main-header {
		padding: 0 16px;
	}
	.page-title {
		font-size: 1.1rem;
	}
	.form-container {
		padding: 16px;
	}

	/* Sidebar Title Visibility on Mobile */
	.sidebar .sidebar-main-title {
		display: none;
	} /* Hide by default */
	.sidebar.sidebar-visible-mobile .sidebar-main-title {
		display: block; /* Show only when mobile sidebar is visible */
		padding: 0;
		text-align: left;
		flex-grow: 1;
		margin-left: 0;
		white-space: normal;
		overflow: visible;
	}
	.sidebar.sidebar-visible-mobile .sidebar-main-title .gradient-text {
		background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
		-webkit-background-clip: text;
		background-clip: text;
		color: transparent;
		font-weight: 600;
	}
	.sidebar.sidebar-visible-mobile .sidebar-header {
		justify-content: flex-start;
		gap: 15px;
	}

	.sidebar.sidebar-visible-mobile .tenant-list-title {
		opacity: 1;
	}
	.sidebar.sidebar-visible-mobile .tenant-list li a span:not(.material-symbols-outlined) {
		opacity: 1;
		display: inline;
	}
	.sidebar.sidebar-visible-mobile .tenant-list li a {
		justify-content: flex-start;
		padding: 8px 22px;
	}
	.sidebar.sidebar-visible-mobile .tenant-list li a .material-symbols-outlined {
		margin-right: 18px;
	}
}

/* Progress tracking styles */
.progress-bar-container {
	width: 100%;
	height: 24px;
	background-color: #e0e0e0;
	border-radius: 4px;
	overflow: hidden;
	margin-bottom: 8px;
}

.progress-bar {
	height: 100%;
	background: linear-gradient(90deg, #4CAF50, #8BC34A);
	transition: width 0.3s ease;
}

.progress-log {
	max-height: 300px;
	overflow-y: auto;
	font-family: 'Roboto Mono', monospace;
	font-size: 12px;
	background-color: #f5f5f5;
	padding: 8px;
	border-radius: 4px;
	margin-top: 8px;
}

.log-entry {
	padding: 2px 0;
}

.log-info {
	color: #333;
}

.log-warning {
	color: #ff9800;
	font-weight: 500;
}

.log-error {
	color: #f44336;
	font-weight: 500;
}

.status-ok {
	color: #81c995;
}

.status-outdated {
	color: #f8cc8a;
}

.status-warning {
	color: #f8cc8a;
}

.status-needs-update {
	color: #8ab4f8;
}

/* Rectify button styles */
.rectify-btn,
.rectify-btn-disabled {
	padding: 6px 12px;
	border: 1px solid var(--input-border);
	border-radius: 6px;
	background-color: var(--button-bg);
	color: var(--button-text);
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
	white-space: nowrap;
}

.rectify-btn:hover {
	background-color: var(--button-hover-bg);
	transform: translateY(-1px);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

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

.rectify-btn-disabled {
	background-color: var(--input-bg);
	color: var(--text-secondary-color);
	cursor: not-allowed;
	opacity: 0.6;
}

.rectify-btn-disabled:hover {
	background-color: var(--input-bg);
	transform: none;
	box-shadow: none;
}

.spinning {
	animation: spin 1s linear infinite;
}

/* Update Schema Button */
.update-schema-btn {
	padding: 10px 20px;
	border: 1px solid var(--input-border);
	border-radius: 8px;
	background-color: var(--button-bg);
	color: var(--button-text);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	white-space: nowrap;
}

.update-schema-btn:hover {
	background-color: var(--button-hover-bg);
	transform: translateY(-1px);
	box-shadow: 0 2px 8px rgba(138, 180, 248, 0.3);
}

.update-schema-btn:active {
	transform: translateY(0);
}

.update-schema-btn:disabled {
	background-color: var(--input-bg);
	color: var(--text-secondary-color);
	cursor: not-allowed;
	opacity: 0.6;
}

.update-schema-btn .material-symbols-outlined {
	font-size: 1.2rem;
}

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