/* MTS Document Repository — UI layer
   Deliberately minimal: inherits the theme's font and colours. */

.mts-docs {
	margin: 1.5em 0;
}

.mts-docs-breadcrumb {
	margin: 0 0 0.75em;
	font-size: 0.95em;
	opacity: 0.85;
}

/* Toolbar: the instant filter and the whole-library search share one row.
   Wraps only when the viewport is too narrow for both. */
.mts-docs-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5em 0.75em;
	margin: 0 0 1em;
}

.mts-docs-toolbar .mts-docs-search,
.mts-docs-toolbar .mts-docs-filter {
	margin: 0;
	display: flex;
	align-items: center;
	gap: 0.4em;
	font-size: 0.95em;
}

.mts-docs-toolbar input[type="search"] {
	min-width: 13em;
	padding: 0.3em 0.5em;
	border: 1px solid rgba(128, 128, 128, 0.4);
	border-radius: 4px;
	background: transparent;
	color: inherit;
	font-size: 0.95em;
}

.mts-docs-toolbar button {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	flex: 0 0 auto;
	width: auto;
	white-space: nowrap;
	line-height: 1.3;
	padding: 0.3em 0.8em;
	border: 1px solid rgba(128, 128, 128, 0.4);
	border-radius: 4px;
	background: transparent;
	color: inherit;
	font-size: 0.95em;
	cursor: pointer;
}

.mts-docs-search-icon {
	flex: 0 0 auto;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.6;
	stroke-linecap: round;
}

.mts-docs-filter-status {
	font-size: 0.8em;
	opacity: 0.7;
	white-space: nowrap;
}

.mts-docs-table {
	width: 100%;
	border-collapse: collapse;
	margin: 0 0 0.75em;
}

/* Themes often draw coloured borders on every table, row and cell. Reset them
   inside the library (the extra specificity beats the theme) and keep only the
   thin rule under each row. */
.mts-docs table.mts-docs-table,
.mts-docs table.mts-docs-table thead,
.mts-docs table.mts-docs-table tbody,
.mts-docs table.mts-docs-table tr {
	border: 0;
	box-shadow: none;
}

.mts-docs table.mts-docs-table th,
.mts-docs table.mts-docs-table td {
	border: 0;
	border-bottom: 1px solid rgba(128, 128, 128, 0.25);
	box-shadow: none;
}

.mts-docs-table th,
.mts-docs-table td {
	padding: 0.5em 0.6em;
	vertical-align: top;
}

.mts-docs table.mts-docs-table thead th {
	text-align: left;
	font-weight: 600;
	border-bottom-width: 2px;
}

/* File-type and folder icons: one tone, line style. Set --mts-docs-icon to match the theme blue. */
.mts-docs-icon {
	display: inline-block;
	width: 1.1em;
	height: 1.1em;
	margin-right: 0.45em;
	vertical-align: -0.2em;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.2;
	stroke-linecap: round;
	stroke-linejoin: round;
	color: var(--mts-docs-icon, #1d5fa8);
}

/* Sortable headers */
.mts-docs-table thead th.mts-docs-sortable {
	cursor: pointer;
	user-select: none;
	white-space: nowrap;
}

.mts-docs-table thead th.mts-docs-sortable:hover {
	text-decoration: underline;
}

.mts-docs-table thead th.mts-docs-sortable::after {
	content: " \2195"; /* ↕ */
	opacity: 0.35;
	font-size: 0.85em;
}

.mts-docs-table thead th.mts-docs-sorted-asc::after {
	content: " \2191"; /* ↑ */
	opacity: 0.9;
}

.mts-docs-table thead th.mts-docs-sorted-desc::after {
	content: " \2193"; /* ↓ */
	opacity: 0.9;
}

.mts-docs-table tbody tr:hover {
	background: rgba(128, 128, 128, 0.07);
}

.mts-docs-dir {
	opacity: 0.65;
	font-size: 0.85em;
}

/* Size and date: secondary to the name, so smaller and muted. */
.mts-docs-table .mts-docs-meta {
	vertical-align: baseline;
	font-size: 0.85em;
	opacity: 0.75;
	white-space: nowrap;
}

.mts-docs-table .mts-docs-size {
	text-align: right;
}

/* Selection column and zip actions (only when core offers zips) */
.mts-docs-table .mts-docs-select {
	width: 1.5em;
	padding-right: 0;
}

.mts-docs-table tbody tr.mts-docs-selected {
	background: rgba(128, 128, 128, 0.12);
}

.mts-docs-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
	margin: 0 0 0.75em;
}

.mts-docs-actions button {
	padding: 0.3em 0.8em;
	border: 1px solid rgba(128, 128, 128, 0.4);
	border-radius: 4px;
	background: transparent;
	color: inherit;
	font-size: 0.9em;
	cursor: pointer;
}

.mts-docs-actions button:disabled {
	opacity: 0.45;
	cursor: default;
}

/* density="compact": smaller text and tighter rows for landing pages */
.mts-docs-compact {
	font-size: 0.9em;
}

.mts-docs-compact .mts-docs-table th,
.mts-docs-compact .mts-docs-table td {
	padding: 0.25em 0.5em;
}

.mts-docs-compact .mts-docs-table td br {
	display: none;
}

.mts-docs-compact .mts-docs-dir {
	margin-left: 0.5em;
}

.mts-docs-note {
	margin: 0.75em 0 0;
	font-size: 0.85em;
	opacity: 0.7;
}

/* Audit-log activity charts (server-rendered SVG, no chart library).
   currentColor keeps them legible in both light and dark admin themes. */
.mts-docs-panel {
	margin: 1.5em 0;
	max-width: 820px;
}

.mts-docs-spark {
	display: block;
	max-width: 100%;
	overflow: visible;
}

.mts-docs-spark-bar {
	fill: currentColor;
	opacity: 0.45;
}

.mts-docs-spark-bar.is-anomaly {
	fill: #d63638;
	opacity: 0.9;
}

.mts-docs-spark-threshold {
	stroke: currentColor;
	stroke-width: 1;
	stroke-dasharray: 4 3;
	opacity: 0.5;
}

.mts-docs-spark-label {
	fill: currentColor;
	font-size: 9px;
	opacity: 0.6;
}

/* Small screens: stack the table into cards */
@media (max-width: 600px) {
	.mts-docs-table thead {
		display: none;
	}

	.mts-docs table.mts-docs-table tr {
		display: block;
		border-bottom: 1px solid rgba(128, 128, 128, 0.25);
		padding: 0.4em 0;
	}

	.mts-docs table.mts-docs-table td {
		display: block;
		border: 0;
		padding: 0.15em 0;
	}

	.mts-docs table.mts-docs-table td.mts-docs-select {
		float: left;
		width: auto;
		padding-right: 0.5em;
	}

	.mts-docs table.mts-docs-table td.mts-docs-meta {
		display: inline;
		padding-right: 0.75em;
		text-align: left;
	}

	.mts-docs-table td[data-label="Size"]::before,
	.mts-docs-table td[data-label="Modified"]::before {
		content: attr(data-label) ": ";
		opacity: 0.6;
		font-size: 0.85em;
	}
}
