/* Página solo gestor: alto de viewport, sin scroll de página vacío */
body.tecnosulf-dir-gestor-landing {
	margin: 0;
	padding: 0;
	height: 100vh;
	max-height: 100vh;
	height: 100dvh;
	max-height: 100dvh;
	overflow-x: hidden;
	overflow-y: hidden;
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
}

body.tecnosulf-dir-gestor-landing .tsg-app {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
	margin: 0;
	max-width: none;
	width: 100%;
	box-sizing: border-box;
}

body.tecnosulf-dir-gestor-landing .tsg-toolbar {
	flex-shrink: 0;
	position: relative;
}

body.tecnosulf-dir-gestor-landing .tsg-login-wrap {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto;
	width: 100%;
	box-sizing: border-box;
}

body.tecnosulf-dir-gestor-landing .tsg-main {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 25px;
	box-sizing: border-box;
}

body.tecnosulf-dir-gestor-landing .tsg-tabs,
body.tecnosulf-dir-gestor-landing .tsg-toolbar-actions {
	flex-shrink: 0;
}

body.tecnosulf-dir-gestor-landing .tsg-table-wrap {
	flex: 1 1 auto;
	min-height: 0;
	overflow: auto;
	-webkit-overflow-scrolling: touch;
}

/* Panel visual gestor — misma línea cromática que el portal */
.tsg-app {
	--tsg-primary: #2d5c47;
	--tsg-primary-dark: #1a3d2e;
	--tsg-accent: #4a8b71;
	--tsg-bg: #f4f7f4;
	--tsg-surface: #ffffff;
	--tsg-border: rgba(45, 92, 71, 0.18);
	--tsg-text: #1a2f24;
	--tsg-muted: rgba(26, 47, 36, 0.72);
	--tsg-radius: 10px;
	--tsg-shadow: 0 8px 28px rgba(26, 61, 46, 0.08);

	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: var(--tsg-text);
	background: var(--tsg-bg);
	margin: 0 -1rem 2rem;
	max-width: none;
	width: 100%;
	box-sizing: border-box;
}

.tsg-toolbar {
	background: var(--tsg-surface);
	border-bottom: 1px solid var(--tsg-border);
	box-shadow: var(--tsg-shadow);
	position: sticky;
	top: 0;
	z-index: 100;
}

.tsg-toolbar__inner {
	max-width: none;
	width: 100%;
	margin: 0;
	padding: 0.75rem 25px;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
}

.tsg-toolbar__logo-img {
	max-height: 44px;
	width: auto;
	display: block;
}

.tsg-toolbar__logo-link {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	color: var(--tsg-primary-dark);
}

.tsg-toolbar__brand {
	font-weight: 700;
	font-size: 1.15rem;
	text-transform: uppercase;
}

.tsg-toolbar__actions {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.tsg-toolbar__user {
	font-size: 0.9rem;
	color: var(--tsg-muted);
}

.tsg-login-wrap {
	max-width: 420px;
	margin: 2rem auto;
	padding: 0 25px;
	box-sizing: border-box;
}

.tsg-main {
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 25px;
	box-sizing: border-box;
}

.tsg-tabs {
	display: flex;
	gap: 0.5rem;
	margin-bottom: 1rem;
	border-bottom: 2px solid var(--tsg-border);
}

.tsg-tab {
	background: transparent;
	border: none;
	padding: 0.65rem 1.1rem;
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--tsg-muted);
	cursor: pointer;
	border-bottom: 3px solid transparent;
	margin-bottom: -2px;
}

.tsg-tab.is-active {
	color: var(--tsg-primary-dark);
	border-bottom-color: var(--tsg-primary);
}

.tsg-toolbar-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 1rem;
}

.tsg-table-wrap {
	background: var(--tsg-surface);
	border-radius: var(--tsg-radius);
	border: 1px solid var(--tsg-border);
	box-shadow: var(--tsg-shadow);
	overflow: auto;
}

.tsg-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9rem;
}

.tsg-table th,
.tsg-table td {
	padding: 0.75rem 1rem;
	text-align: left;
	border-bottom: 1px solid var(--tsg-border);
}

.tsg-table th {
	background: #e9f1ee;
	font-weight: 600;
	color: var(--tsg-primary-dark);
}

.tsg-col-actions {
	white-space: nowrap;
	width: 1%;
	text-align: right;
}

.tsg-col-actions .tsg-icon-btn + .tsg-icon-btn {
	margin-left: 0.25rem;
}

.tsg-icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.35rem;
	height: 2.35rem;
	padding: 0;
	margin: 0;
	box-sizing: border-box;
	border: none;
	border-radius: 8px;
	background: transparent;
	color: var(--tsg-primary);
	cursor: pointer;
	vertical-align: middle;
	-webkit-appearance: none;
	appearance: none;
	font: inherit;
	line-height: 0;
}

.tsg-icon-btn:hover {
	background: #e9f1ee;
}

.tsg-icon-btn:focus-visible {
	outline: 2px solid var(--tsg-accent);
	outline-offset: 2px;
}

.tsg-icon-btn__svg {
	width: 1.2rem;
	height: 1.2rem;
	display: block;
	flex-shrink: 0;
}

.tsg-icon-btn.tsg-del {
	color: #a93226;
}

.tsg-icon-btn.tsg-del:hover {
	background: #fce8e6;
}

.tsg-link {
	background: none;
	border: none;
	color: var(--tsg-primary);
	font-weight: 600;
	cursor: pointer;
	padding: 0;
	font-size: inherit;
	text-decoration: underline;
}

.tsg-del {
	color: #a93226;
}

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

.tsg-card {
	background: var(--tsg-surface);
	border-radius: var(--tsg-radius);
	padding: 1.5rem;
	box-shadow: var(--tsg-shadow);
	border: 1px solid var(--tsg-border);
}

.tsg-card__title {
	margin: 0 0 0.5rem;
	font-size: 1.35rem;
	color: var(--tsg-primary-dark);
}

.tsg-card__intro {
	margin: 0 0 1.25rem;
	color: var(--tsg-muted);
}

.tsg-notice {
	padding: 0.75rem 1rem;
	border-radius: 8px;
	margin-bottom: 1rem;
}

.tsg-notice--err {
	background: #fce8e6;
	border: 1px solid #c0392b;
	color: #7b241c;
}

.tsg-label {
	display: block;
	font-size: 0.85rem;
	font-weight: 600;
	margin-bottom: 0.35rem;
}

.tsg-input {
	width: 100%;
	padding: 0.6rem 0.85rem;
	border: 1px solid var(--tsg-border);
	border-radius: 8px;
	font-size: 1rem;
}

.tsg-remember {
	font-size: 0.85rem;
	color: var(--tsg-muted);
}

.tsg-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.55rem 1.1rem;
	min-height: 2.5rem;
	box-sizing: border-box;
	border: 1px solid transparent;
	border-radius: 8px;
	font: inherit;
	font-weight: 600;
	font-size: 0.9rem;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	vertical-align: middle;
}

.tsg-btn--primary {
	background: var(--tsg-primary);
	border-color: var(--tsg-primary);
	color: #fff;
}

.tsg-btn--primary:hover {
	filter: brightness(1.06);
	color: #fff;
}

.tsg-btn--ghost {
	background: transparent;
	color: var(--tsg-primary);
	border-color: var(--tsg-border);
}

.tsg-btn--ghost:hover {
	background: #e9f1ee;
}

.tsg-modal {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.tsg-modal[hidden] {
	display: none !important;
}

.tsg-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(26, 47, 36, 0.45);
}

.tsg-modal__panel {
	position: relative;
	background: var(--tsg-surface);
	border-radius: var(--tsg-radius);
	padding: 1.5rem;
	max-width: 480px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.tsg-modal__title {
	margin: 0 0 1rem;
	font-size: 1.2rem;
	color: var(--tsg-primary-dark);
}

.tsg-modal__footer {
	display: flex;
	justify-content: flex-end;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 1.25rem;
}

.tsg-modal__footer .tsg-modal__btn {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 2.5rem;
	min-height: 2.5rem;
	max-height: 2.5rem;
	padding-top: 0;
	padding-bottom: 0;
	box-sizing: border-box;
}
