/* ===============================
DOCUMATIC LAYOUT V2
=============================== */

:root {
	--documatic-topbar-height: 80px;
	--documatic-sidebar-width: 25%;
	--documatic-sidebar-min: 260px;
	--documatic-sidebar-max: 380px;
	--documatic-border: #e5e7eb;
	--documatic-sidebar-bg: #f8fafc;
	--documatic-active-bg: #eaf2ff;
	--documatic-active-border: #b8d4ff;

}

/* Base typography: roughly +2px */
body,
table,
td,
th,
input,
button,
select,
textarea,
.btn,
.form-control,
.form-select {
	font-size: 18px !important;
}

/* Top bar */
.navbar,
.fm-navbar,
header,
body > nav {
	min-height: var(--documatic-topbar-height) !important;
	height: var(--documatic-topbar-height) !important;
	padding: 0 24px !important;
	display: flex !important;
	align-items: center !important;
}

/* Two-column main layout */
.documatic-layout {
	display: flex;
	align-items: stretch;
	width: 100%;
	min-height: calc(100vh - var(--documatic-topbar-height));
}

.documatic-sidebar {
	flex: 0 0 var(--documatic-sidebar-width);
	min-width: var(--documatic-sidebar-min);
	max-width: var(--documatic-sidebar-max);
	background: var(--documatic-sidebar-bg);
	border-right: 1px solid var(--documatic-border);
	padding: 24px 18px;
	overflow-y: auto;
	height: calc(100vh - var(--documatic-topbar-height));
	position: sticky;
	top: var(--documatic-topbar-height);
}

.documatic-main {
	flex: 1 1 75%;
	width: 75%;
	padding: 24px 32px;
	overflow-x: auto;
}

.documatic-sidebar-title {
	font-size: 18px;
	font-weight: 700;
	margin: 0 0 14px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--documatic-border);
}

.documatic-folder-tree,
.documatic-folder-tree ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.documatic-folder-tree ul {
	margin-left: 16px;
	padding-left: 10px;
	border-left: 1px solid #e1e5ea;
}

.documatic-folder-tree-item > a {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 8px 10px;
	margin: 2px 0;
	border: 1px solid transparent;
	border-radius: 10px;
	color: #1f2937;
	text-decoration: none;
	line-height: 1.3;
	font-size: 18px;
}

.documatic-folder-tree-item > a:hover {
	background: #fff;
	border-color: var(--documatic-border);
}

.documatic-folder-tree-item.is-active > a {
	background: var(--documatic-active-bg);
	border-color: var(--documatic-active-border);
	font-weight: 700;
}

.documatic-folder-tree-item.is-parent > a {
	font-weight: 600;
}

.documatic-folder-tree-item img.documatic-custom-icon,
.documatic-folder-tree-item .documatic-custom-icon {
	width: 22px;
	height: 22px;
	object-fit: contain;
	flex: 0 0 22px;
}

.documatic-folder-tree-item i.fa {
	width: 22px;
	text-align: center;
	font-size: 20px;
	flex: 0 0 22px;
}

/* File list table */
#main-table td,
#main-table th,
table.table td,
table.table th {
	font-size: 18px !important;
	padding: 14px 16px !important;
	vertical-align: middle !important;
}

.filename a {
	font-size: 18px;
	text-decoration: none;
}

.inline-actions a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 28px;
	min-height: 28px;
	margin: 0 3px;
	text-decoration: none;
}

.inline-actions img.documatic-custom-icon,
.inline-actions .documatic-custom-icon,
.inline-actions i.fa {
	width: 22px;
	height: 22px;
	font-size: 22px;
	object-fit: contain;
}

/* Buttons */
.btn {
	font-size: 16px !important;
	padding: 10px 16px !important;
	border-radius: 8px !important;
}

/* Keep admin/secondary screens usable */
.card,
.path,
.row,
.table-responsive {
	max-width: 100%;
}

@media (max-width: 900px) {
	.documatic-layout {
		flex-direction: column;
	}

	.documatic-sidebar,
	.documatic-main {
		width: 100%;
		max-width: none;
		min-width: 0;
		flex-basis: auto;
		height: auto;
		position: relative;
		top: auto;
	}

	.documatic-sidebar {
		border-right: 0;
		border-bottom: 1px solid var(--documatic-border);
	}
}

/* ===============================
DOCUMATIC HEADER + MESSAGE FLOW FIX
=============================== */

/* Header height */
.navbar,
.fm-navbar,
header,
body > nav {
	height: var(--documatic-topbar-height) !important;
	min-height: var(--documatic-topbar-height) !important;
}

/*
The fixed header is already offset by Tiny File Manager's body.navbar-fixed margin.
Do NOT also add body padding, otherwise the sidebar/footer area loses vertical space.
*/
body {
	padding-top: 0 !important;
}

body.navbar-fixed {
	margin-top: var(--documatic-topbar-height) !important;
}

/* Messages stay in normal flow and push content down when visible. */
.message.alert,
.alert.message,
.fm-alert,
.fm-message {
	position: relative !important;
	z-index: 3000 !important;
	margin: 12px 24px 16px !important;
}

/* Remove forced extra top spacing that was making the page too tall. */
.container-fluid,
.fm-container,
.path,
.fm-main,
.documatic-main {
	padding-top: 0 !important;
}

.documatic-main {
	padding-top: 24px !important;
}

/* Sticky left sidebar: keep footer/profile visible inside viewport. */
.fm-sidebar,
.documatic-sidebar {
	top: var(--documatic-topbar-height) !important;
	height: calc(100vh - var(--documatic-topbar-height)) !important;
}

/* File list container card style */
.fm-main table.table,
.documatic-main table.table,
.file-list-wrapper {
	background: #ffffff;
	border-radius: 12px !important;
	box-shadow: 0 2px 10px rgba(0,0,0,0.06);
	overflow: hidden;
	border: 1px solid #ececec;
}

/* Optional: inner spacing around the table */
.fm-main,
.documatic-main {
	padding: 24px;
}

/* Optional: soften table header */
table.table thead th {
	background: #fafafa;
}

/* Sidebar user greeting block */
.documatic-user-card {
	position: sticky;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 90px;
	padding: 14px 18px;
	background: #fff;
	border-top: 1px solid #e5e5e5;
	margin-top: auto;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.documatic-user-greeting {
	font-size: 14px;
	color: #666;
	margin-bottom: 8px;
}

.documatic-user-row {
	display: flex;
	align-items: center;
	gap: 12px;
}

.documatic-user-avatar {
	width: 42px;
	height: 42px;
	border-radius: 50%;
	object-fit: cover;
	background: #eee;
	flex-shrink: 0;
}

.documatic-user-meta {
	display: flex;
	flex-direction: column;
}

.documatic-user-name {
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
}

.documatic-user-role {
	font-size: 13px;
	color: #8a8a8a;
	line-height: 1.2;
}

/* ===============================
DOCUMATIC USER AVATARS + SIDEBAR FOOTER
=============================== */
.documatic-sidebar {
	display: flex !important;
	flex-direction: column !important;
	overflow: hidden !important;
}

.documatic-sidebar-tree {
	flex: 1 1 auto;
	overflow-y: auto;
	padding-bottom: 18px;
}

.documatic-user-card {
	flex: 0 0 90px;
	height: 90px;
	padding: 12px 4px 0;
	background: var(--documatic-sidebar-bg, #f8fafc);
	border-top: 1px solid #e5e7eb;
	margin-top: 10px;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.documatic-user-greeting {
	font-size: 14px !important;
	color: #666;
	margin-bottom: 8px;
	font-weight: 500;
}

.documatic-user-row {
	display: flex;
	align-items: center;
	gap: 12px;
}

.documatic-user-avatar,
.documatic-admin-avatar {
	width: 42px;
	height: 42px;
	border-radius: 50%;
	object-fit: cover;
	background: #e5e7eb;
	border: 1px solid #d1d5db;
	flex-shrink: 0;
}

.documatic-admin-avatar-large {
	width: 56px;
	height: 56px;
}

.documatic-user-meta {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.documatic-user-name {
	font-size: 16px !important;
	font-weight: 700;
	line-height: 1.2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.documatic-user-role {
	font-size: 13px !important;
	color: #7a7f87;
	line-height: 1.2;
	margin-top: 3px;
}
