/**
 * JB Planeación — estilos del panel de configuración (?config=1).
 * Complementa admin.css con formularios, tablas y pestañas de ajustes.
 */

body.logistica-config-panel-page {
	background: #f1f5f9;
}

.logistica-config .logistica-app-rail {
	z-index: 1005;
}

.logistica-config .logistica-inventory-nav {
	z-index: 1004;
}

.logistica-config .logistica-header--config.logistica-header--slim {
	background: transparent;
	border: 0;
	box-shadow: none;
	margin: 0 1rem 0.75rem;
	padding: 0.85rem 0 0;
}

.logistica-config .logistica-header--slim .logistica-header__section {
	font-size: 1.35rem;
	margin: 0;
}

.logistica-config .logistica-header--slim .logistica-header__user-bar {
	margin-top: 0.65rem;
}

@media (min-width: 900px) {
	.logistica-config .logistica-header--slim {
		align-items: center;
		display: flex;
		flex-wrap: wrap;
		gap: 1rem;
		justify-content: space-between;
	}

	.logistica-config .logistica-header--slim .logistica-header__user-bar {
		margin-top: 0;
	}
}

.logistica-config .logistica-inventory-body {
	background: #f1f5f9;
}

.logistica-config .logistica-tab-panels {
	padding: 0 1rem 1.5rem;
}

.logistica-config .logistica-tab-panel.is-active {
	display: block;
}

.logistica-config .logistica-tab-panel > .description:first-child,
.logistica-config .logistica-tab-panel > p.description {
	color: #64748b;
	font-size: 0.9375rem;
	line-height: 1.5;
	margin: 0 0 1.25rem;
	max-width: 72ch;
}

/* Avisos */
.logistica-config .notice {
	background: #fff;
	border: 1px solid #c3c4c7;
	border-left-width: 4px;
	border-radius: 8px;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
	margin: 0 0 1rem;
	padding: 0.75rem 1rem;
}

.logistica-config .notice-success {
	border-left-color: #0f766e;
}

.logistica-config .notice p {
	margin: 0;
}

/* Botones (estilo wp-admin dentro del panel config) */
.logistica-config .button,
.logistica-config a.button,
.logistica-config button.button {
	appearance: none;
	background: #f8fafc;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
	color: #0f172a;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	font-size: 13px;
	font-weight: 600;
	gap: 0.35rem;
	height: auto;
	line-height: 1.3;
	min-height: 34px;
	padding: 0.45rem 0.9rem;
	text-decoration: none;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.logistica-config .button:hover,
.logistica-config .button:focus-visible,
.logistica-config a.button:hover,
.logistica-config a.button:focus-visible {
	background: #fff;
	border-color: #94a3b8;
	color: #0f172a;
	outline: none;
}

.logistica-config .button-primary,
.logistica-config a.button-primary,
.logistica-config button.button-primary {
	background: #0f766e;
	border-color: #0d6b63;
	color: #fff;
}

.logistica-config .button-primary:hover,
.logistica-config .button-primary:focus-visible {
	background: #0d6b63;
	border-color: #0b5f58;
	color: #fff;
}

.logistica-config .button-secondary,
.logistica-config a.button-secondary {
	background: #fff;
	border-color: #cbd5e1;
	color: #334155;
}

.logistica-config .button-link,
.logistica-config a.button-link {
	background: transparent;
	border-color: transparent;
	box-shadow: none;
	color: #0f766e;
	padding-left: 0;
	padding-right: 0;
}

.logistica-config .button-link:hover,
.logistica-config .button-link:focus-visible {
	color: #0d6b63;
	text-decoration: underline;
}

.logistica-config .button-link-delete {
	background: transparent;
	border-color: transparent;
	box-shadow: none;
	color: #b42318;
}

.logistica-config .button-link-delete:hover,
.logistica-config .button-link-delete:focus-visible {
	color: #991b1b;
	text-decoration: underline;
}

/* Campos de formulario */
.logistica-config input[type="text"],
.logistica-config input[type="email"],
.logistica-config input[type="number"],
.logistica-config input[type="date"],
.logistica-config input[type="url"],
.logistica-config input[type="password"],
.logistica-config select,
.logistica-config textarea,
.logistica-config .regular-text {
	background: #fff;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	box-sizing: border-box;
	color: #0f172a;
	font-size: 14px;
	line-height: 1.4;
	max-width: 100%;
	padding: 0.5rem 0.65rem;
}

.logistica-config input:focus,
.logistica-config select:focus,
.logistica-config textarea:focus {
	border-color: #0f766e;
	box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
	outline: none;
}

.logistica-config code {
	background: #f1f5f9;
	border-radius: 4px;
	font-size: 0.85em;
	padding: 0.1rem 0.35rem;
}

/* Tablas */
.logistica-config .widefat,
.logistica-config table.widefat {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-collapse: collapse;
	border-radius: 10px;
	border-spacing: 0;
	overflow: hidden;
	width: 100%;
}

.logistica-config .widefat thead th,
.logistica-config .widefat tfoot th {
	background: #f8fafc;
	border-bottom: 1px solid #e2e8f0;
	color: #334155;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.02em;
	padding: 0.65rem 0.85rem;
	text-align: left;
	text-transform: uppercase;
}

.logistica-config .widefat td,
.logistica-config .widefat th {
	padding: 0.65rem 0.85rem;
	vertical-align: middle;
}

.logistica-config .widefat.striped tbody tr:nth-child(odd) {
	background: #fafbfc;
}

.logistica-config .widefat tbody tr + tr td,
.logistica-config .widefat tbody tr + tr th {
	border-top: 1px solid #eef2f7;
}

.logistica-config .form-table {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	border-collapse: separate;
	border-spacing: 0;
	overflow: hidden;
	width: 100%;
}

.logistica-config .form-table th {
	background: #f8fafc;
	border-bottom: 1px solid #eef2f7;
	color: #334155;
	font-weight: 600;
	padding: 0.85rem 1rem;
	text-align: left;
	vertical-align: top;
	width: 220px;
}

.logistica-config .form-table td {
	border-bottom: 1px solid #eef2f7;
	padding: 0.85rem 1rem;
	vertical-align: top;
}

.logistica-config .form-table tr:last-child th,
.logistica-config .form-table tr:last-child td {
	border-bottom: 0;
}

/* Secciones Inicio / panel-admin-settings */
.logistica-config .logistica-panel-admin-settings {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
	margin-bottom: 1.25rem;
	padding: 1.15rem 1.25rem 1.25rem;
}

.logistica-config .logistica-panel-admin-settings h2 {
	border-bottom: 1px solid #eef2f7;
	color: #0f172a;
	font-size: 1.125rem;
	margin: 0 0 0.5rem;
	padding-bottom: 0.65rem;
}

.logistica-config .logistica-panel-admin-settings > p {
	color: #64748b;
	margin: 0 0 1rem;
}

.logistica-config .logistica-panel-admin-settings .logistica-table-wrap {
	margin-bottom: 0.75rem;
}

.logistica-config .logistica-panel-compra-statuses-form__tools,
.logistica-config .logistica-panel-admin-settings .submit {
	margin-top: 0.85rem;
}

.logistica-config .logistica-panel-admin-settings + .logistica-panel-admin-settings {
	margin-top: 0;
}

/* Cabecera configuración */
.logistica-config .logistica-header--config:not(.logistica-header--slim) {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
	margin: 0 1rem 1rem;
	padding: 1rem 1.25rem;
}

.logistica-config .logistica-header--config .logistica-header__section {
	margin-bottom: 0;
}

.logistica-config .logistica-header--config:not(.logistica-header--slim) .logistica-header__meta {
	margin: 0.35rem 0 0;
}

.logistica-config .logistica-header--config:not(.logistica-header--slim) .logistica-header__user-bar {
	margin-top: 0.85rem;
}

@media (min-width: 900px) {
	.logistica-config .logistica-header--config:not(.logistica-header--slim) {
		align-items: flex-start;
		display: flex;
		flex-wrap: wrap;
		gap: 1rem;
		justify-content: space-between;
	}

	.logistica-config .logistica-header--config:not(.logistica-header--slim) .logistica-header__user-bar {
		margin-top: 0;
	}
}

/* Formulario standalone: crear / editar usuario */
body.logistica-user-form-page {
	background: linear-gradient(160deg, #ecfdf5 0%, #f1f5f9 42%, #f8fafc 100%);
	color: #0f172a;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	min-height: 100vh;
}

.logistica-user-form-page {
	padding: 24px 16px 48px;
}

.logistica-user-form {
	margin: 0 auto;
	max-width: 920px;
}

.logistica-user-form__hero {
	margin-bottom: 20px;
}

.logistica-user-form__back {
	align-items: center;
	background: rgba(255, 255, 255, 0.92);
	border: 1px solid #99f6e4;
	border-radius: 999px;
	box-shadow: 0 1px 2px rgba(15, 118, 110, 0.08);
	color: #0f766e;
	display: inline-flex;
	font-size: 13px;
	font-weight: 600;
	gap: 6px;
	line-height: 1.3;
	margin-bottom: 20px;
	padding: 8px 16px 8px 12px;
	text-decoration: none;
	transition:
		background 0.15s ease,
		border-color 0.15s ease,
		box-shadow 0.15s ease,
		color 0.15s ease,
		transform 0.15s ease;
}

.logistica-user-form__back:hover,
.logistica-user-form__back:focus-visible {
	background: #fff;
	border-color: #0f766e;
	box-shadow: 0 4px 12px rgba(15, 118, 110, 0.14);
	color: #0d6b63;
	outline: none;
	text-decoration: none;
	transform: translateX(-2px);
}

.logistica-user-form__back-icon {
	align-items: center;
	display: inline-flex;
	flex-shrink: 0;
	height: 16px;
	justify-content: center;
	width: 16px;
}

.logistica-user-form__back-icon svg {
	display: block;
	height: 16px;
	width: 16px;
}

.logistica-user-form__back-label {
	white-space: nowrap;
}

.logistica-user-form__brand {
	color: #0f766e;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	margin: 0 0 6px;
	text-transform: uppercase;
}

.logistica-user-form__title {
	color: #0f172a;
	font-size: clamp(1.75rem, 4vw, 2.25rem);
	line-height: 1.15;
	margin: 0 0 8px;
}

.logistica-user-form__intro {
	color: #64748b;
	font-size: 15px;
	line-height: 1.55;
	margin: 0;
	max-width: 52ch;
}

.logistica-user-form__notice {
	align-items: flex-start;
	border-radius: 12px;
	display: flex;
	font-size: 14px;
	gap: 10px;
	line-height: 1.45;
	margin-bottom: 16px;
	padding: 12px 14px;
}

.logistica-user-form__notice .dashicons {
	flex-shrink: 0;
	margin-top: 1px;
}

.logistica-user-form__notice--error {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #b91c1c;
}

.logistica-user-form__body {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 18px;
	box-shadow: 0 20px 48px rgba(15, 118, 110, 0.08);
	overflow: hidden;
}

.logistica-user-form__section {
	border-bottom: 1px solid #e2e8f0;
	padding: 24px;
}

.logistica-user-form__section:last-of-type {
	border-bottom: 0;
}

.logistica-user-form__section-head h2,
.logistica-user-form__section > .logistica-user-form__section-head h2 {
	color: #0f172a;
	font-size: 1.05rem;
	margin: 0 0 4px;
}

.logistica-user-form__section-head p,
.logistica-user-form__section > .logistica-user-form__section-head p {
	color: #64748b;
	font-size: 14px;
	line-height: 1.45;
	margin: 0 0 18px;
}

.logistica-user-form__fields {
	display: grid;
	gap: 16px;
	grid-template-columns: 1fr;
}

@media (min-width: 720px) {
	.logistica-user-form__fields {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.logistica-user-form__field--wide {
		grid-column: 1 / -1;
	}
}

.logistica-user-form__field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.logistica-user-form__label {
	color: #0f172a;
	font-size: 13px;
	font-weight: 600;
}

.logistica-user-form__input {
	background: #fff;
	border: 1px solid #cbd5e1;
	border-radius: 10px;
	box-sizing: border-box;
	color: #0f172a;
	font: inherit;
	min-height: 44px;
	padding: 10px 12px;
	width: 100%;
}

.logistica-user-form__input:focus {
	border-color: #0f766e;
	box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
	outline: none;
}

.logistica-user-form__hint {
	color: #94a3b8;
	font-size: 12px;
	line-height: 1.4;
}

.logistica-user-form__password-wrap {
	display: grid;
	grid-template-columns: 1fr auto;
	position: relative;
}

.logistica-user-form__password-wrap .logistica-user-form__input {
	padding-right: 44px;
}

.logistica-user-form__password-toggle {
	align-items: center;
	background: transparent;
	border: 0;
	border-radius: 8px;
	color: #64748b;
	cursor: pointer;
	display: inline-flex;
	height: 36px;
	justify-content: center;
	margin: 4px;
	position: absolute;
	right: 0;
	top: 0;
	width: 36px;
}

.logistica-user-form__password-toggle:hover,
.logistica-user-form__password-toggle:focus-visible {
	background: #f1f5f9;
	color: #0f766e;
	outline: none;
}

.logistica-user-form__role-grid {
	display: grid;
	gap: 10px;
	grid-template-columns: 1fr;
}

@media (min-width: 640px) {
	.logistica-user-form__role-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.logistica-user-form__role-card {
	align-items: flex-start;
	background: #f8fafc;
	border: 2px solid #e2e8f0;
	border-radius: 14px;
	cursor: pointer;
	display: flex;
	gap: 12px;
	padding: 14px;
	transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.logistica-user-form__role-card:hover {
	background: #fff;
	border-color: #99f6e4;
}

.logistica-user-form__role-card.is-selected {
	background: #ecfdf5;
	border-color: #0f766e;
	box-shadow: 0 0 0 1px rgba(15, 118, 110, 0.08);
}

.logistica-user-form__role-card input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.logistica-user-form__role-icon {
	align-items: center;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	color: #0f766e;
	display: inline-flex;
	flex-shrink: 0;
	height: 40px;
	justify-content: center;
	width: 40px;
}

.logistica-user-form__role-card.is-selected .logistica-user-form__role-icon {
	background: #0f766e;
	border-color: #0f766e;
	color: #fff;
}

.logistica-user-form__role-icon .dashicons {
	font-size: 20px;
	height: 20px;
	width: 20px;
}

.logistica-user-form__role-copy {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.logistica-user-form__role-copy strong {
	color: #0f172a;
	font-size: 14px;
	line-height: 1.3;
}

.logistica-user-form__role-copy span {
	color: #64748b;
	font-size: 12px;
	line-height: 1.45;
}

.logistica-user-form__details {
	border-top: 1px solid #e2e8f0;
}

.logistica-user-form__details > summary {
	align-items: center;
	color: #0f172a;
	cursor: pointer;
	display: flex;
	font-size: 14px;
	font-weight: 600;
	gap: 8px;
	list-style: none;
	padding: 16px 24px;
}

.logistica-user-form__details > summary::-webkit-details-marker {
	display: none;
}

.logistica-user-form__details > summary em {
	color: #94a3b8;
	font-size: 12px;
	font-style: normal;
	font-weight: 500;
	margin-left: auto;
}

.logistica-user-form__details[open] > summary {
	border-bottom: 1px solid #e2e8f0;
}

.logistica-user-form__details-body {
	padding: 16px 24px 24px;
}

.logistica-user-form__details-intro {
	color: #64748b;
	font-size: 13px;
	line-height: 1.45;
	margin: 0 0 16px;
}

.logistica-user-form__tabs-grid {
	display: grid;
	gap: 16px;
	grid-template-columns: 1fr;
}

@media (min-width: 720px) {
	.logistica-user-form__tabs-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.logistica-user-form__tabs-group {
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	margin: 0;
	min-width: 0;
	padding: 12px;
}

.logistica-user-form__tabs-group legend {
	color: #0f172a;
	font-size: 13px;
	font-weight: 700;
	margin-bottom: 8px;
	padding: 0 4px;
}

.logistica-user-form__tabs-list {
	display: flex;
	flex-direction: column;
	gap: 6px;
	max-height: 220px;
	overflow: auto;
}

.logistica-user-form__tab-item {
	align-items: center;
	border-radius: 8px;
	color: #334155;
	cursor: pointer;
	display: flex;
	font-size: 13px;
	gap: 8px;
	padding: 6px 8px;
}

.logistica-user-form__tab-item:hover {
	background: #f8fafc;
}

.logistica-user-form__tab-item input {
	accent-color: #0f766e;
}

.logistica-user-form__actions {
	align-items: center;
	background: #f8fafc;
	border-top: 1px solid #e2e8f0;
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	justify-content: space-between;
	padding: 18px 24px;
}

.logistica-user-form__actions-start,
.logistica-user-form__actions-end {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.logistica-user-form__actions-end {
	margin-left: auto;
}

.logistica-user-delete-form {
	display: inline;
	margin: 0;
}

.logistica-user-form__btn {
	align-items: center;
	appearance: none;
	border-radius: 10px;
	box-sizing: border-box;
	cursor: pointer;
	display: inline-flex;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	gap: 6px;
	justify-content: center;
	line-height: 1.3;
	min-height: 44px;
	padding: 0 18px;
	text-decoration: none;
	transition:
		background 0.15s ease,
		border-color 0.15s ease,
		box-shadow 0.15s ease,
		color 0.15s ease,
		transform 0.15s ease;
}

.logistica-user-form__btn-icon {
	align-items: center;
	display: inline-flex;
	flex-shrink: 0;
	height: 18px;
	justify-content: center;
	width: 18px;
}

.logistica-user-form__btn-icon svg {
	display: block;
	height: 18px;
	width: 18px;
}

.logistica-user-form__btn--submit {
	background: #0f766e;
	border: 1px solid #0d6b63;
	box-shadow: 0 1px 2px rgba(15, 118, 110, 0.2);
	color: #fff;
}

.logistica-user-form__btn--submit:hover,
.logistica-user-form__btn--submit:focus-visible {
	background: #0d6b63;
	border-color: #0b5f58;
	box-shadow: 0 4px 12px rgba(15, 118, 110, 0.24);
	color: #fff;
	outline: none;
	transform: translateY(-1px);
}

.logistica-user-form__btn--cancel {
	background: #fff;
	border: 1px solid #cbd5e1;
	color: #334155;
}

.logistica-user-form__btn--cancel:hover,
.logistica-user-form__btn--cancel:focus-visible {
	background: #f8fafc;
	border-color: #94a3b8;
	color: #0f172a;
	outline: none;
	text-decoration: none;
	transform: translateY(-1px);
}

.logistica-user-form__btn--delete {
	background: #fff;
	border: 1px solid #fecaca;
	color: #b42318;
}

.logistica-user-form__btn--delete:hover,
.logistica-user-form__btn--delete:focus-visible {
	background: #fef2f2;
	border-color: #f87171;
	box-shadow: 0 4px 12px rgba(180, 35, 24, 0.12);
	color: #991b1b;
	outline: none;
	transform: translateY(-1px);
}

@media (max-width: 640px) {
	.logistica-user-form__actions {
		align-items: stretch;
		flex-direction: column;
	}

	.logistica-user-form__actions-start,
	.logistica-user-form__actions-end {
		margin-left: 0;
		width: 100%;
	}

	.logistica-user-form__actions-end {
		flex-direction: column-reverse;
	}

	.logistica-user-form__btn {
		width: 100%;
	}
}

.logistica-user-form__notice--success {
	background: #ecfdf5;
	border: 1px solid #99f6e4;
	color: #0f766e;
}

.logistica-user-form__section--profile {
	padding-top: 20px;
}

.logistica-user-form__profile-card {
	align-items: center;
	background: linear-gradient(135deg, #f8fafc 0%, #ecfdf5 100%);
	border: 1px solid #d1fae5;
	border-radius: 14px;
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	padding: 16px 18px;
}

.logistica-user-form__avatar {
	align-items: center;
	background: #0f766e;
	border-radius: 14px;
	color: #fff;
	display: inline-flex;
	flex-shrink: 0;
	font-size: 15px;
	font-weight: 700;
	height: 52px;
	justify-content: center;
	letter-spacing: 0.04em;
	width: 52px;
}

.logistica-user-form__profile-copy {
	display: flex;
	flex: 1 1 180px;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.logistica-user-form__profile-copy strong {
	color: #0f172a;
	font-size: 1.05rem;
	line-height: 1.25;
}

.logistica-user-form__profile-login {
	color: #64748b;
	font-size: 13px;
}

.logistica-user-form__profile-email {
	color: #475569;
	font-size: 13px;
	word-break: break-word;
}

.logistica-user-form__profile-role {
	background: #fff;
	border: 1px solid #99f6e4;
	border-radius: 999px;
	color: #0f766e;
	font-size: 12px;
	font-weight: 700;
	margin-left: auto;
	padding: 0.35rem 0.75rem;
	white-space: nowrap;
}

.logistica-user-form-page--edit .logistica-user-form__section:first-of-type {
	border-bottom: 0;
}

@media (max-width: 640px) {
	.logistica-user-form__profile-role {
		margin-left: 0;
	}
}

/* Permisos por rol: botón + modal */
.logistica-role-permissions-trigger {
	align-items: center;
	appearance: none;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	box-sizing: border-box;
	color: #0f172a;
	cursor: pointer;
	display: flex;
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	gap: 8px;
	padding: 10px 12px;
	text-align: left;
	transition:
		background 0.15s ease,
		border-color 0.15s ease,
		box-shadow 0.15s ease;
	width: 100%;
}

.logistica-role-permissions-trigger:hover,
.logistica-role-permissions-trigger:focus-visible {
	background: #f8fafc;
	border-color: #0f766e;
	box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
	outline: none;
}

.logistica-role-permissions-trigger__title {
	color: #0f766e;
	flex: 1 1 auto;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.03em;
	line-height: 1.35;
	min-width: 0;
	text-transform: uppercase;
}

.logistica-role-permissions-trigger__meta {
	color: #64748b;
	flex: 0 0 auto;
	font-size: 12px;
	font-weight: 500;
	white-space: nowrap;
}

.logistica-role-permissions-trigger__icon {
	align-items: center;
	color: #64748b;
	display: inline-flex;
	flex-shrink: 0;
	height: 16px;
	justify-content: center;
	width: 16px;
}

.logistica-role-permissions-trigger__icon svg {
	display: block;
	height: 16px;
	width: 16px;
}

.logistica-role-permissions-panel-source[hidden] {
	display: none !important;
}

body.logistica-role-permissions-modal-open {
	overflow: hidden;
}

.logistica-role-permissions-modal {
	align-items: center;
	display: flex;
	inset: 0;
	justify-content: center;
	padding: 20px;
	position: fixed;
	z-index: 100000;
}

.logistica-role-permissions-modal[hidden] {
	display: none !important;
}

.logistica-role-permissions-modal__backdrop {
	background: rgba(15, 23, 42, 0.45);
	inset: 0;
	position: absolute;
}

.logistica-role-permissions-modal__panel {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18);
	display: grid;
	grid-template-rows: auto minmax(0, 1fr) auto;
	max-height: calc(100vh - 40px);
	max-width: 560px;
	overflow: hidden;
	position: relative;
	width: 100%;
	z-index: 1;
}

.logistica-role-permissions-modal__head {
	align-items: flex-start;
	background: linear-gradient(180deg, #f8fffe 0%, #fff 100%);
	border-bottom: 1px solid #e2e8f0;
	display: flex;
	gap: 12px;
	justify-content: space-between;
	padding: 16px 18px;
}

.logistica-role-permissions-modal__head-copy h3 {
	color: #0f172a;
	font-size: 1.05rem;
	line-height: 1.3;
	margin: 0;
}

.logistica-role-permissions-modal__head-copy p {
	color: #64748b;
	font-size: 13px;
	line-height: 1.4;
	margin: 4px 0 0;
}

.logistica-role-permissions-modal__close {
	appearance: none;
	background: transparent;
	border: 0;
	color: #64748b;
	cursor: pointer;
	font-size: 24px;
	line-height: 1;
	padding: 0;
}

.logistica-role-permissions-modal__body {
	overflow: auto;
	padding: 14px 18px 18px;
	-webkit-overflow-scrolling: touch;
}

.logistica-role-permissions-modal__body .logistica-frontend-menu-picker--compact {
	gap: 8px;
	grid-template-columns: 1fr;
	margin: 0;
	max-height: none;
	overflow: visible;
}

.logistica-role-permissions-modal__foot {
	background: #f8fafc;
	border-top: 1px solid #e2e8f0;
	display: flex;
	justify-content: flex-end;
	padding: 14px 18px;
}

@media (min-width: 783px) {
	.logistica-role-permissions-table .logistica-role-permissions-trigger__title {
		display: none;
	}

	.logistica-role-permissions-table .logistica-role-permissions-trigger {
		justify-content: flex-end;
	}
}

/* Tabla de usuarios JB en configuración */
	text-align: right;
	width: 96px;
}

.logistica-user-row-actions {
	text-align: right;
	vertical-align: middle;
	white-space: nowrap;
}

.logistica-user-row-actions__group {
	align-items: center;
	display: inline-flex;
	flex-wrap: nowrap;
	gap: 6px;
	justify-content: flex-end;
}

.logistica-config-users-table .logistica-config-users-row__user {
	min-width: 0;
	vertical-align: middle;
}

.logistica-config-users-table .logistica-config-users-row__name {
	color: #0f172a;
	display: block;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
}

.logistica-config-users-table .logistica-config-users-row__login {
	color: #64748b;
	display: block;
	font-size: 12px;
	line-height: 1.35;
	margin-top: 2px;
}

.logistica-config-users-table .logistica-config-users-row__login::before {
	content: "@";
}

.logistica-config-users-table .logistica-config-users-row__role {
	vertical-align: middle;
}

.logistica-config-users-table .logistica-config-users-row__role-badge {
	background: #ecfdf5;
	border: 1px solid #99f6e4;
	border-radius: 999px;
	color: #0f766e;
	display: inline-block;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.3;
	padding: 0.3rem 0.65rem;
	white-space: nowrap;
}

.logistica-config-users-table .logistica-config-users-row__actions {
	text-align: right;
	vertical-align: middle;
	white-space: nowrap;
	width: 88px;
}

.logistica-config-users-table .logistica-user-delete-form {
	display: inline-flex;
	margin: 0;
	vertical-align: middle;
}

.logistica-user-delete-form {
	display: inline-flex;
	margin: 0;
	vertical-align: middle;
}

.logistica-user-row-actions__btn {
	align-items: center;
	border: 1px solid transparent;
	border-radius: 8px;
	box-sizing: border-box;
	cursor: pointer;
	display: inline-flex;
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	height: auto;
	justify-content: center;
	line-height: 1.2;
	min-height: 34px;
	padding: 0.4rem 0.85rem;
	text-decoration: none;
	transition:
		background 0.15s ease,
		border-color 0.15s ease,
		box-shadow 0.15s ease,
		color 0.15s ease;
}

.logistica-user-row-actions__btn--icon {
	font-size: 0;
	height: 34px;
	line-height: 0;
	min-height: 34px;
	padding: 0;
	width: 34px;
}

.logistica-user-row-actions__btn-icon {
	align-items: center;
	display: inline-flex;
	flex-shrink: 0;
	height: 16px;
	justify-content: center;
	width: 16px;
}

.logistica-user-row-actions__btn-icon svg {
	display: block;
	height: 16px;
	width: 16px;
}

.logistica-user-row-actions__btn--edit {
	background: #fff;
	border-color: #cbd5e1;
	color: #334155;
}

.logistica-user-row-actions__btn--edit:hover,
.logistica-user-row-actions__btn--edit:focus-visible {
	background: #f8fafc;
	border-color: #94a3b8;
	color: #0f172a;
}

.logistica-user-row-actions__btn--delete {
	background: #fff;
	border-color: #fecaca;
	color: #b42318;
}

.logistica-user-row-actions__btn--delete:hover,
.logistica-user-row-actions__btn--delete:focus-visible {
	background: #fef2f2;
	border-color: #f87171;
	color: #991b1b;
}

@media (max-width: 640px) {
	.logistica-user-row-actions__head {
		text-align: right;
	}
}

/* Tabla usuarios: tarjeta compacta en móvil */
@media (max-width: 782px) {
	.logistica-config .logistica-config-users-table tbody tr.logistica-config-users-row {
		align-items: center;
		display: grid;
		gap: 6px 12px;
		grid-template-areas:
			"user actions"
			"role actions";
		grid-template-columns: minmax(0, 1fr) auto;
		padding: 12px 14px;
	}

	.logistica-config .logistica-config-users-table tbody tr.logistica-config-users-row > td {
		border: 0;
		display: block;
		padding: 0;
	}

	.logistica-config .logistica-config-users-table tbody tr.logistica-config-users-row > td + td {
		border-top: 0;
	}

	.logistica-config .logistica-config-users-table .logistica-config-users-row__user::before,
	.logistica-config .logistica-config-users-table .logistica-config-users-row__role::before,
	.logistica-config .logistica-config-users-table .logistica-config-users-row__actions::before {
		content: none;
		display: none;
	}

	.logistica-config .logistica-config-users-table .logistica-config-users-row__user {
		grid-area: user;
		min-width: 0;
	}

	.logistica-config .logistica-config-users-table .logistica-config-users-row__role {
		grid-area: role;
	}

	.logistica-config .logistica-config-users-table .logistica-config-users-row__actions {
		align-self: center;
		grid-area: actions;
		text-align: right;
		width: auto;
	}

	.logistica-config .logistica-config-users-table .logistica-user-row-actions__group {
		justify-content: flex-end;
	}
}

/* Configuración: tablas y permisos en móvil */
@media (max-width: 782px) {
	.logistica-config .logistica-configuracion-card__head,
	.logistica-config .logistica-configuracion-card__body {
		padding-left: 1rem;
		padding-right: 1rem;
	}

	.logistica-config .logistica-table-wrap--responsive {
		overflow: visible;
	}

	.logistica-config .logistica-config-responsive-table {
		background: transparent;
		border: 0;
		border-collapse: separate;
		border-spacing: 0;
	}

	.logistica-config .logistica-config-responsive-table thead {
		border: 0;
		clip: rect(0 0 0 0);
		height: 1px;
		margin: -1px;
		overflow: hidden;
		padding: 0;
		position: absolute;
		white-space: nowrap;
		width: 1px;
	}

	.logistica-config .logistica-config-responsive-table tbody,
	.logistica-config .logistica-config-responsive-table tr,
	.logistica-config .logistica-config-responsive-table td {
		display: block;
		width: 100%;
	}

	.logistica-config .logistica-config-responsive-table tr {
		background: #fff;
		border: 1px solid #e2e8f0;
		border-radius: 12px;
		box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
		margin-bottom: 14px;
		overflow: hidden;
	}

	.logistica-config .logistica-config-responsive-table tr:last-child {
		margin-bottom: 0;
	}

	.logistica-config .logistica-config-responsive-table td {
		border: 0;
		box-sizing: border-box;
		padding: 14px 16px;
		white-space: normal;
	}

	.logistica-config .logistica-config-responsive-table td + td {
		border-top: 1px solid #eef2f7;
	}

	.logistica-config .logistica-config-responsive-table td[data-label]::before {
		color: #0f766e;
		content: attr(data-label);
		display: block;
		font-size: 11px;
		font-weight: 700;
		letter-spacing: 0.04em;
		margin-bottom: 8px;
		text-transform: uppercase;
	}

	.logistica-config .logistica-role-permissions-table__role {
		background: linear-gradient(135deg, #f8fafc 0%, #ecfdf5 100%);
		padding-bottom: 16px;
		padding-top: 16px;
	}

	.logistica-config .logistica-role-permissions-table__role::before {
		content: none;
	}

	.logistica-config .logistica-role-permissions-table__role strong {
		color: #0f172a;
		display: block;
		font-size: 16px;
		line-height: 1.3;
		margin-bottom: 6px;
	}

	.logistica-config .logistica-role-permissions-table__role .description {
		font-size: 13px;
		line-height: 1.45;
		margin: 0 0 10px;
	}

	.logistica-config .logistica-role-permissions-table__role code {
		background: rgba(255, 255, 255, 0.85);
		border: 1px solid #d1fae5;
		border-radius: 999px;
		display: inline-block;
		font-size: 11px;
		padding: 0.2rem 0.55rem;
	}

	.logistica-config .logistica-role-permissions-table__panel {
		padding: 12px 16px;
	}

	.logistica-config .logistica-role-permissions-table__panel + .logistica-role-permissions-table__panel {
		border-top: 1px solid #eef2f7;
	}

	.logistica-config .logistica-role-permissions-trigger__title {
		display: block;
	}

	.logistica-config .logistica-role-permissions-table .logistica-frontend-menu-picker,
	.logistica-config .logistica-role-permissions-table .logistica-frontend-menu-picker--compact {
		gap: 8px;
		grid-template-columns: 1fr;
		margin: 0;
		max-height: none;
		overflow: visible;
	}

	.logistica-config .logistica-role-permissions-table .logistica-frontend-menu-picker__item {
		font-size: 14px;
		gap: 12px;
		min-height: 48px;
		padding: 12px 14px;
	}

	.logistica-config .logistica-role-permissions-table .logistica-frontend-menu-picker__item span {
		line-height: 1.35;
		word-break: break-word;
	}

	.logistica-config .logistica-role-permissions-table .logistica-frontend-menu-picker__item input {
		flex-shrink: 0;
		height: 18px;
		width: 18px;
	}

	.logistica-config .logistica-frontend-menu-picker--config {
		grid-template-columns: 1fr;
		max-height: none;
		overflow: visible;
	}

	.logistica-config .logistica-frontend-menu-picker--config .logistica-frontend-menu-picker__item {
		min-height: 48px;
	}

	.logistica-config .logistica-config-users-table .logistica-config-responsive-table__actions::before {
		content: none;
		display: none;
	}

	.logistica-config .logistica-configuracion-card__actions .button {
		justify-content: center;
		width: 100%;
	}
}

@media (max-width: 480px) {
	.logistica-config .logistica-configuracion-tab__intro h2 {
		font-size: 1.2rem;
	}

	.logistica-config .logistica-configuracion-card__head h3 {
		font-size: 1rem;
	}
}
